我创造了UserControl
这样的:
MyUserCtrl myctrl = new MyUserCtrl() { DataContext = new MyViewModel()};
ControlCollection.Add(myctrl);
我用它把它输出ItemsControl ItemsSource="{Binding ControlCollection}"
到视图。
它干净漂亮,但问题是我不知道如何关闭UserControls
我打开的那些。
如果我只是将它删除到集合中怎么办。因此视图模型也会关闭吗?