Need a little help with Options Window and IsGlassEnabled

Ribbon for WPF Forum

Posted 7 years ago by Adam Davis
Version: 12.1.0562
Avatar

Hey guys banging my head here a bit I have a popup options window that allows me to change various settings in my app. So far everything has been pretty simple to implement and effect the main window. But I'm trying to implement a checkbox true/false button on the option window that will bind or tie to the IsGlassEnabled property of the parent Window. How can I do this?

Comments (4)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Adam,

The problem is that you can't set a binding in XAML unless your options window exposes a property that contains its OwnerWindow. The Window class has an Owner property that you may be able to use to bind the checkbox to, such as below:

<CheckBox IsChecked="{Binding ElementName=optionsWindow, Path=Owner.(ribbon:RibbonWindow.IsGlassEnabled)}" />

I didn't personally try this, but it seems like it should work. Also, I was assuming that you were using a window for your options, not a popup button or the like, if that’s not what you meant let me know.


Actipro Software Support

Posted 7 years ago by Adam Davis
Avatar

I am using a Window, I assume the ElementName is the name of the options window.

Posted 7 years ago by Adam Davis
Avatar

Unfortunately thats not workign though.

<CheckBox Width="74"
                  Height="17"
                  Margin="200,120,0,0"
                  HorizontalAlignment="Left"
                  VerticalAlignment="Top"
                  Content="Toggle Aero Glass"
                  FlowDirection="RightToLeft"
                  IsChecked="{Binding ElementName=optionsWindow, Path=Owner.(ribbon:RibbonWindow.IsGlassEnabled)}" />

I do have this on the form as well, it's just after the public partial class declaration

        #region Dependency Properties

        /// <summary>
        /// Identifies the <see cref="Ribbon"/> dependency property.  This field is read-only.
        /// </summary>
        /// <value>The identifier for the <see cref="Ribbon"/> dependency property.</value>
        public static readonly DependencyProperty RibbonProperty = DependencyProperty.Register("Ribbon", typeof(ActiproSoftware.Windows.Controls.Ribbon.Ribbon), typeof(OptionsWindow), new FrameworkPropertyMetadata(null));        

        #endregion

[Modified 7 years ago]

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Adam,

Sorry to hear that, it might not be able to be done in an XAML binding then unless you expose some RIbbonWindow based property on your options window so that you can bind to it.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.