|
Is there a bug related to using many items in a conductor? I need to manage a few thousand view model instances and wanted to use a Conductor<ItemViewModel>.Collection.OneActive for that, but as soon as I close the app, I get a StackOverflowException
in Caliburn.Micro.dll.
Even tested it in a clean new project with very simple view models and views, but with the same result. This project crashes at about 8000 items, my actual application even sooner (about 5000-6000).
That'd be the main view model and the view model for single items:
public class MainViewModel : Conductor<ItemViewModel>.Collection.OneActive
{
public MainViewModel()
{
for (int i = 0; i < 8000; ++i)
{
this.Items.Add(new ItemViewModel(i.ToString()));
}
}
}
public class ItemViewModel : PropertyChangedBase
{
private string _name;
public ItemViewModel(string name)
{
this._name = name;
}
public string Name
{
get { return this._name; }
set
{
this._name = value;
this.NotifyOfPropertyChange(() => this.Name);
}
}
}
The XAML is just a ListBox in the MainView and a TextBlock in the ItemView:
<Window x:Class="CaliburnMicroTest2.Views.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainView" Height="300" Width="300">
<Grid>
<ListBox x:Name="Items"/>
</Grid>
</Window>
<UserControl x:Class="CaliburnMicroTest2.Views.ItemView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextBlock x:Name="Name"/>
</UserControl>
Anyone had this happen before?
|