Ribbon Backstage Button

Good Day! Is there a way to set the visibility of the back button on Ribbon backstage control? 


Thank you for your response! 


3 Replies 1 reply marked as answer

TB Thirupathi Bala Krishnan Syncfusion Team January 14, 2022 09:33 AM UTC

Hi Lowell, 
 
Thanks for contacting Syncfusion support. 
 
We currently do not have a direct API to hide the visibility of the backstage back button. However, you can meet this reported requirement by making the following changes to your application's code. We recommend using reflection to get the "backbutton" instance from the backstage. Following that, you can set the visibility value to collapsed according on your need. 
 
 
Please refer the following code sample. 
 
# MainWindow.xaml.cs

 
using Syncfusion.Windows.Tools.Controls; 
using System.Reflection; 
 
        public Window1() 
        { 
            InitializeComponent(); 
            if (mainRibbon.BackStage != null) 
            { 
                this.mainRibbon.BackStage.Loaded += BackStage_Loaded; 
            } 
        } 
 
        private void BackStage_Loaded(object sender, RoutedEventArgs e) 
        { 
                FieldInfo field = this.mainRibbon.BackStage.GetType().GetField("backbutton", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static); 
                object obj = field.GetValue(this.mainRibbon.BackStage); 
                if(obj is RibbonButton) 
                  (obj as RibbonButton).Visibility = Visibility.Collapsed; 
        } 
 
 
 
Please refer the following screenshot for your reference. 
 
 
 
Please let us know if you need any further assistance. 
 
Regards,
Thirupathi B.
 


Marked as answer

LO Lowell January 17, 2022 01:42 AM UTC

Thank you! It worked perfectly!



TB Thirupathi Bala Krishnan Syncfusion Team January 17, 2022 07:52 AM UTC

Hi Lowell, 

We are glad to know that the provided solution resolved your reported issue at your end. Please let us know if you need any further assistance on this. As always, we are happy to assist you. 

Regards, 
Thirupathi B. 


Loader.
Up arrow icon