是否可以安全地假設WPF雙向數據綁定不會對不具備焦點的控件起作用?WPF雙向數據綁定限制
例如在下面的代碼中。
<Window.Resources>
<XmlDataProvider x:Key="TestBind1" XPath="/BindTest1">
<x:XData>
<BindTest1 xmlns="">
<Value1>True</Value1>
</BindTest1>
</x:XData>
</XmlDataProvider>
</Window.Resources>
<StackPanel>
<GroupBox>
<StackPanel>
<RadioButton Content="Value1" IsChecked="{Binding Source={StaticResource TestBind1},Mode=TwoWay, XPath=Value1}"/>
<RadioButton Content="Value2"/>
</StackPanel>
</GroupBox>
<Button Content="Analyse" Click="OnAnalyseClicked"/>
</StackPanel>
當我在單選按鈕點擊值2,BindTest1 /值1的值將保持真正因爲單選按鈕值1改變,而它沒有具有焦點?
這是WPF的正常行爲嗎?我知道我可以通過使用各種技術避免這種情況,但我想問這是否正常,或者是我的Xaml缺少導致此問題的某些參數。