我在我的視圖中有一個名爲'Ribbon'的功能區,其中有2個選項卡,如下面的示例代碼。我點擊Button1時會打開Tab2,反之亦然。我將如何做到這一點?如何以編程方式切換選項卡?
<ribbon:Ribbon x:Name="ribbon" HelpPaneContent="{x:Static data:WordModel.Help}">
<ribbon:RibbonTab Header="Tab1" ... >
<ribbon:RibbonGroup x:Name="Button1" >
<ribbon:RibbonButton Clicked="SwitchToTab2" />
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
<ribbon:RibbonTab Header="Tab2" ... >
<ribbon:RibbonGroup x:Name="Button2" >
<ribbon:RibbonButton Clicked="SwitchToTab1" />
</ribbon:RibbonGroup>
</ribbon:RibbonTab>
...
</ribbon:Ribbon>
希望有人能幫助我。 Nam。
也許看到http://stackoverflow.com/questions/7929646/how-to- programmaticaly選-A-TabItem的功能於WPF-的tabcontrol/25960172#25960172? – 2014-09-21 14:23:26