同様の動作を持つカスタムコントロールを構築しているため、IsCheckedプロパティがどのように機能するかを理解しようとしています。RadioButton
私が必要とする情報は、otherがチェックされたときに a がRadioButton自動的にどのように変わるかです。IsCheckedfalseRadioButton
例を参照してください。
<StackPanel>
<RadioButton Content="Info 1" IsChecked="True" />
<RadioButton Content="Info 2" />
</StackPanel>
クリックするRadioButtonと"Info 2"、他のラジオは自動的にオフになります。
しかし、ラジオが次のStackPanelように異なる場合:
<StackPanel>
<StackPanel>
<RadioButton Content="Info 1.1" IsChecked="True" />
<RadioButton Content="Info 1.2" />
</StackPanel>
<StackPanel>
<RadioButton Content="Info 2.1" IsChecked="True" />
<RadioButton Content="Info 2.2" />
</StackPanel>
</StackPanel>
Info 1.1をクリックすると、チェックされたままInfo 2.1になります。
私のカスタム コントロールには、この動作が必要です。それを行う最もクリーンな方法は何ですか?