Hi,
I've got a VehicleViewModel that has a sub ViewModel of NotesViewModel
public IManageVehicleNotesViewModel NotesViewModel { get; set; }
On the first activation of VehicleViewModel I activate the sub ViewModel.
NotesViewModel.Activate();
The activation calls a method to init a number of Commands, I've break pointed this and its being called.
CreateCommand = new DelegateCommand<object>(OnCreateCommand, CanCreate);
However although the TextBoxes are binding on the sub View (so the DataContext is in place) none of the commands are binding - I've tried to calling RaiseCanExecuteChanged on the commands but they don't disable, enable or call the methods as expected.
I don't know whether its relevant (as the TextBoxes are binding) but I'm associating the View and ViewModel using a ResourceDictionary as so ...
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:v="clr-namespace:GTS.GRS.N3.Modules.Vehicles.Views"
xmlns:vm="clr-namespace:GTS.GRS.N3.Modules.Vehicles.Model">
<DataTemplate DataType="{x:Type vm:ManageVehicleViewModel}">
<v:ManageVehicleView />
</DataTemplate>
<DataTemplate DataType="{x:Type vm:ManageVehicleNotesViewModel}">
<v:ManageVehicleNotesView />
</DataTemplate>
</ResourceDictionary>
The commands on the top level VehicleViewModel work.
Has anyone experienced anything like this? Is it the order I'm doing things? Any help gratefully received!
Cheers,
Andy