Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
855
XamRibbon 11.2: Disabled Ribbon Images
posted

How can I set a enabled and disabled image for the buttontools, so that depending on the enabled/disabled state, the corresponding image is displayed?

Parents
No Data
Reply
  • 17559
    Verified Answer
    posted

    Hello Casper,

    You can achieve such functionality by creating a new converter for the ButtonTool and change the Image depending on the IsEnabled property of the control.

    For example you can try the following snippet that will convert the state:

            public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
            {
                if ((bool)value)
                    return new Uri("tick.png", UriKind.Relative);
                else
                    return new Uri("cross.png", UriKind.Relative);
            }
    

     

     

    For additional reference please refer to the attached sample.  

    If you need any further assistance with this matter please feel free to ask.

    XamRibbonDifferentImage.zip
Children