This is a migrated thread and some comments may be shown as answers.

RadRibbonDropDownButton.DropDownContent not opening

2 Answers 63 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
Niko
Top achievements
Rank 1
Niko asked on 24 Sep 2013, 12:30 AM
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; }
   set
   {
      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 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 26 Sep 2013, 11:15 AM
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.

Regards,
Stefan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
0
Niko
Top achievements
Rank 1
answered on 27 Sep 2013, 06:51 PM
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)));
Tags
RibbonView and RibbonWindow
Asked by
Niko
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Niko
Top achievements
Rank 1
Share this question
or