Posted 16 years ago
by Andy Ver Murlen
Why does setting Selector.IsSelected = true on a Tab in a ribbbon not quite work? I am trying to stick to my m-v-vm pattern using the ribbon control and frequently need to make a specific tab active from the viewmodel. I have a property on the viewmodel "IsMyTabSelected" and bound this property to a tab's Selector.IsSelected property.
However, when the property gets set to true, the tab indeed gets selected, but does not display it's contents. The previously selected tab is also selected, and it's contents are what is actually displayed. SO I end up with 2 tabs "selected" but the contents of the first being displayed.
Also, why doesn't this work to set the selected tab? Surely simple xaml binding should work? However, when the window is loaded, the File tab will be selected, not the Action tab.Thanks
[Modified at 03/03/2009 10:20 AM]
However, when the property gets set to true, the tab indeed gets selected, but does not display it's contents. The previously selected tab is also selected, and it's contents are what is actually displayed. SO I end up with 2 tabs "selected" but the contents of the first being displayed.
Also, why doesn't this work to set the selected tab? Surely simple xaml binding should work? However, when the window is loaded, the File tab will be selected, not the Action tab.
<ribbon:Ribbon
x:Name="uxRibbon_MainRibbon"
DockPanel.Dock="Top"
themes:ThemeManager.Theme="AeroNormalColor"
SelectedTab={Binding ElementName=uxRibbonTab_Actions}"
>
<ribbon:Tab x:Name="uxRibbonTab_File" Label="File" Id="File"/>
<ribbon:Tab x:Name="uxRibbonTab_Edit" Label="Edit" Id="Edit"/>
<ribbon:Tab x:Name="uxRibbonTab_Actions" Label="Actions" Id="Actions"/>
</ribbon:Ribbon>
[Modified at 03/03/2009 10:20 AM]