Wire up the disposer for cleaning up unused objects, i.e disposing a VM will remove it from the view
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
namespace Hyperbar.Windows.Primary;
|
||||
|
||||
public class WidgetComponentViewModelEnumerator(PrimaryWidgetConfiguration configuration,
|
||||
IViewModelFactory<PrimaryCommandConfiguration, IWidgetComponentViewModel?> factory) :
|
||||
IViewModelEnumerator<IWidgetComponentViewModel>
|
||||
{
|
||||
public async IAsyncEnumerable<IWidgetComponentViewModel?> Next()
|
||||
{
|
||||
foreach (PrimaryCommandConfiguration item in configuration)
|
||||
{
|
||||
yield return await factory.CreateAsync(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user