そのため、コードの別の部分を機能させようとしていたときにそれを理解しました。
私の元のラジオボタンはこのように見えました。
<!--Unit Selector-->
<ribbon:RibbonGroup x:Name="Unit_Selection" Header="Units">
<StackPanel DataContext="{StaticResource Settings}">
<!--Metric-->
<RadioButton GroupName="UnitsSelector" Content="mm" x:Name="Metric" IsChecked="{Binding Path=Default.Units, Mode=TwoWay, Converter={StaticResource enumBooleanConverter},
ConverterParameter=mm}" />
<!--Imperial-->
<RadioButton GroupName="UnitsSelector" Content="inches" x:Name="Imperial" IsChecked="{Binding Path=Default.Units, Mode=TwoWay, Converter={StaticResource enumBooleanConverter},
ConverterParameter=inches}" />
</StackPanel>
</ribbon:RibbonGroup>
バインディングをユーザー設定列挙型に向けました。
バインディングをプロパティに変更しました。xaml コードを取得するには
<ribbon:RibbonGroup x:Name="Unit_Selection" Header="Units">
<StackPanel>
<RadioButton IsChecked="{Binding Path=UnitProperty, Converter={StaticResource enumBooleanConverter}, ConverterParameter=mm}">mm</RadioButton>
<RadioButton IsChecked="{Binding Path=UnitProperty, Converter={StaticResource enumBooleanConverter}, ConverterParameter=inches}">inches</RadioButton>
</StackPanel>
</ribbon:RibbonGroup>
...そしてプロパティ
public Unit UnitProperty
{
get
{
return Properties.Settings.Default.Units;
}
set
{
if (Properties.Settings.Default.Units != value)
{
Properties.Settings.Default.Units = value;
NotifyPropertyChanged("UnitProperty");
NotifyPropertyChanged(String.Empty);
}
}
}
NotifyPropertyChange(String.Empty); を追加する必要がありました。それを取得して他のプロパティを更新します。
INotifyPropertyChanged を基本クラスとして通知クラスに追加する必要があることもわかりました。
次に、ユーザーが mm とインチを切り替えたときの処理を追加する必要があります。