I cannot for the life of me get my ViewModel to update my View when I replace a member with a new instance.
My ViewModel contains the proper (I believe) notification that the Test member has been changed through OnPropertyChanged (verified to work with binding to other members):
public class ServerViewModel
{
private TestViewModel _Test;
public TestViewModel Test
{
get {return _Test;}
set {_Test = value;OnPropertyChange("Test");}
}
...
...
}
In my codebehind I instantiate the ServerViewModel in the MainWindow() constructor and set the datacontext:
VServer = new ServerViewModel();
this.DataContext = VServer;
In my view model I have a function that loads a test by assigning a new instance:
VServer.Test = new Test("c:\test\test3.test");
My XAML tries to bind to members of Test through:
<TextBox x:Name="TextTestName"
...
Text="{Binding Test.Name, Mode=TwoWay}"/>
But when I load a test the control bindings do not recognize that a new object has been created and do not update their content. Any ideas?