2009-07-16 65 views

回答

0

將您所有的複選框綁定到相同的屬性(從您的ViewModel,你有一個,對吧?)。然後他們都會顯示相同的信息。

沒有太多的綁定代碼..你可以嘗試像...

<TabControl> 
    <TabItem Header="Tab1"> 
     <StackPanel> 
      <CheckBox Content="One" Checked="{Binding Path=MyProperty}"/> 
      <CheckBox Content="Two" Checked="{Binding Path=MyProperty}"/> 
     </StackPanel> 
    </TabItem> 
    <TabItem Header="Tab2"> 
     <StackPanel> 
      <CheckBox Content="Three" Checked="{Binding Path=MyProperty}"/> 
      <CheckBox Content="Four" Checked="{Binding Path=MyProperty}"/> 
     </StackPanel> 
    </TabItem> 
</TabControl> 

..where MyProperty是代表你想顯示狀態的本地屬性。

+0

你能否給我提供一些示例代碼? – Sauron 2009-07-16 07:36:58

相關問題