RadRibbonDropDownButton.DropDownContent not opening

3 posts, 0 answers
  1. Niko
    Niko avatar
    14 posts
    Member since:
    Jul 2012

    Posted 23 Sep 2013 Link to this post

    Hey guys,

    I have RadRibbonDropDownButtons with drop down content inside a RadRibbonView.QuickAccessToolBar.  I also have functionality to dynamically change telerik themes.

    When the application opens, I am able to click the RadRibbonDropDownButtons and see the drop down content perfectly fine, but when I change themes the drop down content does not open. All other telerik components work fine.

    Below is the code to dynamically change themes. Any ideas on what would cause the button's not to display their drop down content?
    public Theme ThisApplicationTheme
       get { return StyleManager.ApplicationTheme; }
          StyleManager.ApplicationTheme = value;
          var binding = new Binding("ThisApplicationTheme") { Source = this, Mode = BindingMode.OneWay };
           foreach (Window window in Application.Current.Windows)
                foreach (var element in GetWindow(window).AllChildren<FrameworkElement>().ToList())
                     element.SetBinding(StyleManager.ThemeProperty, binding);
           Application.Current.MainWindow.SetBinding(StyleManager.ThemeProperty, binding);
  2. Stefan
    Stefan avatar
    89 posts

    Posted 26 Sep 2013 Link to this post

    Hello Niko,

    Unfortunately I wasn't able to reproduce the described issue.

    I created a sample project in which I included your code snippet for theme changing. I attached this project and I would like to ask you to examine it and let us know if I have missed something while trying to reproduce the issue. Also feel free to modify it in order to show us how you have hit this problem.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Niko
    Niko avatar
    14 posts
    Member since:
    Jul 2012

    Posted 27 Sep 2013 Link to this post

    Thanks for the response Stefan.

    I was not able to reproduce the issue within your project either, but after some debugging and trial and error I found the issue. In case anyone else runs into this issue, here was my solution.

    I noticed that the problem RadRibbonDropDownButton's would never fully Load after changing the theme. The 'Loading' event never got fired and IsLoaded was always false, even though the element was focusable and clickable. Using the Dispatcher to bind the elements fixed this for me.

    Dispatcher.BeginInvoke(new Action(() => element.SetBinding(StyleManager.ThemeProperty, binding)));
Back to Top