This commit is contained in:
TheXamlGuy
2024-01-18 22:40:55 +00:00
parent 2fed876182
commit 19e83d5043
5 changed files with 26 additions and 34 deletions
@@ -0,0 +1,15 @@
namespace Hyperbar.Windows.Primary;
public class WidgetComponentViewModelProvider(ICache<Guid, IWidgetComponentViewModel> cache) :
IProvider<PrimaryCommandConfiguration, IWidgetComponentViewModel?>
{
public IWidgetComponentViewModel? Get(PrimaryCommandConfiguration value)
{
if (cache.TryGetValue(value.Id, out IWidgetComponentViewModel? viewModel))
{
return viewModel;
}
return default;
}
}