Articles in this section
Category / Section

How to retain the same BackStageTabItem selected on opening the BackStage in WPF Ribbon control?

1 min read

You can use the BackStageOpening event to set the SelectedIndex of BackStage and maintain the same BackStageTabItem selected when opening the BackStage in WPF Ribbon control.

XAML

<syncfusion:Ribbon  x:Name="_ribbon" BackStageOpening="_ribbon_BackStageOpening"  VerticalAlignment="Top">
     <syncfusion:RibbonTab Caption="Home">
           <syncfusion:RibbonBar></syncfusion:RibbonBar>
     </syncfusion:RibbonTab>
     <syncfusion:Ribbon.BackStage>
           <syncfusion:Backstage >
                 <syncfusion:BackstageTabItem Header="Tab1" Content="Item1"></syncfusion:BackstageTabItem>
                 <syncfusion:BackstageTabItem Header="Tab2" Content="Item2"></syncfusion:BackstageTabItem>
                 <syncfusion:BackstageTabItem Header="Tab3" Content="Item3"></syncfusion:BackstageTabItem>
           </syncfusion:Backstage>
     </syncfusion:Ribbon.BackStage>
</syncfusion:Ribbon>

C#

// BackStage Opening event
private void _ribbon_BackStageOpening(object sender, System.ComponentModel.CancelEventArgs e)
{
   // Set the selectedindex for BackStageTabItems
   _ribbon.BackStage.SelectedIndex = 0;
}

 

                  The first tabitem selected on BackStage opening in WPF Ribbon

View sample in GitHub.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied