Articles in this section

How to Detect the Switching of the RibbonTab in Winui Ribbon Control?

You can detect when the RibbonTab is switched in the Winui Ribbon control by handling the SelectionChanged event.

XAML:

<ribbon:sfribbon x:name="ribbon" selectedtabchanged="ribbon_SelectedTabChanged">
   <ribbon:sfribbon.tabs>
       <ribbon:ribbontab header="Home"/>
       <ribbon:ribbontab header="Insert"/>
       <ribbon:ribbontab header="View"/>
       <ribbon:ribbontab header="Layout"/>
   </ribbon:sfribbon.tabs>
</ribbon:sfribbon> 

C#:

private void ribbon_SelectedTabChanged(object sender, SelectionChangedEventArgs e)
{
    ContentDialog dialog = new ContentDialog();

    dialog.XamlRoot = this.Content.XamlRoot;
    dialog.Title = "Message";
    dialog.Content = "Selection Tab Changed";
    dialog.PrimaryButtonText = "Ok";
    dialog.CloseButtonText = "Cancel";

    await dialog.ShowAsync();
} 

DetectRibbon.png

Conclusion

I hope you enjoyed learning how to detect the switching of the RibbonTab in Winui Ribbon control.
.

You can refer to our WinUI Ribbon feature tour page to learn about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.

For current customers, you can check out our components from the Licence 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 forum, Support portal, or feedback portal. We are always happy to assist you!

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