How to detect the switching of RibbonTab in WPF Ribbon control?
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"); }
I hope you enjoyed learning about how to detect the switching of RibbonTab in WPF Ribbon control.
You can refer to our WPF Ribbon feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Ribbon example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!