I have a window named 'winAppt.xaml' and a view model called 'ItemViewModel.vb'. I would like the user to be able to open multiple instances of the 'winAppt.xaml' window to show different accounts on the screen at once. Problem right now is that when the second instance of 'winAppt.xaml' loads the first instance has some of it's data replaced with the second instance.
I'm 开发者_如何学Gocurrently doing something like this
Dim i As New ItemViewModel()
i.Load(itemID)
Dim fDetailRec As New winAppt(i)
fDetailRec.ShowDialog()
I then set the DataContext of my window to the view model passed in.
Public Sub New(ByVal i As ItemViewModel)
Me.DataContext = i
End Sub
Found a shared reference to a class inside the view model. This class was declared in a module and persisted throughout the application. This class contained a list that I thought I was passing to my ViewModel, it was really referencing it.
精彩评论