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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to detect the switching of RibbonTab in WPF Ribbon control?

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

You can detect the switching of the RibbonTab in WPF Ribbon control by using SelectionChanged event.

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");
}

 

Shows the event called on switching tab in WPF Ribbon

View sample in GitHub.

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