I am trying to use the latest Preview version of MVVM-Light (V4 - BL16 - Mix11) in my WPF v4 app that was using MVVM-light V3 Sp1.
In my ViewModel, I have the following property defined
private WifiNetwork _selectedNetwork;
public WifiNetwork SelectedNetwork
{
get
{
return _selectedNetwork;
}
set
{
if (_selectedNetwork == value)
return;
_selectedNetwork = value;
RaisePropertyChanged("SelectedNetwork");
}
}
This property is binded to ListBox's SelectedItem in the View XAML.
I have the following RelayCommand defined in my viewModel
private RelayCommand _connectCommand;
public RelayCommand ConnectCommand
{
get
{
if (_connectCommand == null)
{
_connectCommand = new RelayCommand(
() => ConnectToSpecifiedNetwork(SelectedNetwork),
() => SelectedNetwork != null && ! SelectedNetwork.IsConnected);
}
return _connectCommand;
}
}
This RelayCommand is binded to my "Connect" button.
When the selected item is not already connected (IsConnected is false), then the connect button should enable.
This worked perfect in MVVM-Light V3 Sp1. But when I use the MIX 11 preview version of MVVM-Light, this doesn't seem to work anymore.
Any suggestions?
I can upload my entire project somewhere if needed..