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
255
Global Themes
posted

Hi Guys,

  I am trying to dynamicaly set the theme for my applicaiton!

This is what I am trying:

Public Sub SetTheme(ByVal theme As String) Implements Interfaces.IThemeService.SetTheme

Application.Current.Resources.MergedDictionaries.Clear()

For Each group In ThemeManager.GetGroupingsForTheme(theme)Dim mege As ResourceDictionary = ThemeManager.GetResourceSet(theme, group)

Application.Current.Resources.MergedDictionaries.Add(mege)

Next

End Sub

 

But I do not seam to be getting any change! 

 

 

  • 255
    posted

    Ok, So I found (http://forums.infragistics.com/forums/p/10352/39777.aspx#39777) this and that solved my theme switching problem. I do not know if it works yet, but I think it is doing something as I am now getting an exception from the Composite WPF framework saying that my "regions" already contain controls.

    I think this is due to a low level redraw inacting the "Adapt" method on the RegionManger and it trying to re-adapt the controls...

     Has anyone run into this?