I have a Page inside a Wizard with 4 Radio Buttons (2 Groups) in a WPF Application. I'm using .Net4 and Caliburn Micro.
When click and Set a Value it's properly bound to the corresponding property. When i leave the Page and return, i need to set the properties from in code and expect them via NotifyPropertyChanged to be updated on the Page. But non of the RadioButtons gets checked, even though the corresponding property gets set...
Does anyone know how that should work with caliburn.micro?!
here's the xaml:
<RadioButton Name="NewInstallChecked" GroupName="InstallType" Content="New Installation (default)" Margin="75,10,0,0" />
<RadioButton Name="UpdateInstallChecked" GroupName="InstallType" Content="Update of existing Installation" Margin="75,10,0,0" />
<Label Content="Please select which version of Siseco you want to install:" Height="28" HorizontalAlignment="Left" Margin="20,20,0,0" Name="label2" VerticalAlignment="Top" />
<RadioButton Name="ServerChecked" GroupName="Version" Content="Server version (default)" Margin="75,10,0,0" />
<RadioButton Name="ClientChecked" GroupName="Version" Content="Client version" Margin="75,10,0,0" />
and here the code in my view model:
public bool ClientChecked
{
get { return _clientChecked; }
set { _clientChecked = value; NotifyOfPropertyChange(() => ClientChecked); }
}
public bool ServerChecked
{
get { return _serverChecked; }
set { _serverChecked = value; NotifyOfPropertyChange(() => ServerChecked); }
}
public bool NewInstallChecked
{
get { return _newInstallChecked; }
set { _newInstallChecked = value; NotifyOfPropertyChange(() => NewInstallChecked); }
}
public bool UpdateInstallChecked
{
get { return _updateInstallChecked; }
set { _updateInstallChecked = value; NotifyOfPropertyChange(() => UpdateInstallChecked);}
}
...
protected override void OnActivate()
{
NewInstallChecked = _options.NewInstall;
UpdateInstallChecked = _options.UpdateInstall;
ServerChecked = _options.ServerInstall;
ClientChecked = _options.ClientInstall;
base.OnActivate();
}
changed
event, not a property initialised event). Also try setting thechecked
bool values in the constructor of the VM and see if that makes a difference – SextIsChecked="{Binding Path=ClientChecked, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
– Shelleyshellfire