WPF アプリケーションに 4 つのラジオ ボタン (2 つのグループ) を持つウィザード内にページがあります。.Net4 と Caliburn Micro を使用しています。
クリックして値を設定すると、対応するプロパティに適切にバインドされます。ページを離れて戻ったら、コードからプロパティを設定し、NotifyPropertyChanged を介してページで更新されることを期待する必要があります。ただし、対応するプロパティが設定されていても、RadioButtons はチェックされません...
それがcaliburn.microでどのように機能するか知っている人はいますか?!
ここに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" />
そしてここに私のビューモデルのコード:
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();
}