)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to detect the switching of RibbonTab in Ribbon?

Platform: WPF |
Control: Ribbon |
Published Date: December 27, 2017 |
Last Revised Date: December 27, 2017
Tags: wpf, ribbon, ribbontab

To detect the Switching of the RibbonTab in Ribbon Control, the SelectionChanged event of Ribbon can be used. The same has been demonstrated in the following code example:

XAML:

<syncfusion:Ribbon RibbonState="Normal" VerticalAlignment="Top" x:Name="_ribbon" SelectionChanged="_ribbon_SelectionChanged" >

<syncfusion:RibbonTab Caption="Mail" IsChecked="False" >

<syncfusion:RibbonBar Header="Acions">

<syncfusion:RibbonButton SizeForm="Small" Label="Copy Folder"/>

<syncfusion:RibbonButton SizeForm="Small" Label="Move Folder"/>

<syncfusion:SplitButton Label=" Split1 "  SizeForm="Large" >

<syncfusion:RibbonButton SizeForm="Small" Label="Mark to Download"/>

<syncfusion:RibbonButton SizeForm="Small" Label="UnMark to Download"/>

</syncfusion:SplitButton>

</syncfusion:RibbonBar>

</syncfusion:RibbonTab>

 

<syncfusion:RibbonTab Caption="Home" IsChecked="False" >

<syncfusion:RibbonBar Header="Properties">

<syncfusion:RibbonButton SizeForm="Small" Label="Policy"/>

<syncfusion:RibbonButton SizeForm="Small" Label="Folder Properties"/>

<syncfusion:RibbonButton SizeForm="Small" Label="Folder Permissions"/>

</syncfusion:RibbonBar>

</syncfusion:RibbonTab>

 

<syncfusion:RibbonTab Caption="Send/Receive" IsChecked="False" >

<syncfusion:RibbonBar Header="Report">

<syncfusion:RibbonButton SizeForm="Small" Label="ReportPolicy"/>

<syncfusion:RibbonButton SizeForm="Small" Label="ReportProperties"/>

<syncfusion:RibbonButton SizeForm="Small" Label="ReportPermissions"/>

</syncfusion:RibbonBar>

</syncfusion:RibbonTab>

</syncfusion:Ribbon>

 

 

C#:

 // Invoke on selection change of Ribbon Tab

private void _ribbon_SelectionChanged(object sender, SelectionChangedEventArgs e)

{

MessageBox.Show("Tab switched", "Message");

 

}

 

                                            Fig i: Screenshot shows the event called on switching the tab

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon