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
250
Changing themes at runtime throws an exception
posted

Whenever I change themes at runtime by changing the ThemeManager.CurrentTheme property I get a null reference exception (stack trace below). The first time I change it, it works fine, but every subsequent time it fails. Is there something more I need to be doing than just setting that property?

Also, even running the sample posted by Alex in this thread http://community.infragistics.com/forums/p/37459/224447.aspx I get an exception when I change the theme.

   at System.Windows.DeferredResourceReference.RemoveInflatedListener(ResourceReferenceExpression listener)
   at System.Windows.ResourceReferenceExpression.InvalidateCacheValue()
   at System.Windows.ResourceReferenceExpression.InvalidateExpressionValue(Object sender, EventArgs e)
   at System.Windows.TreeWalkHelper.InvalidateResourceReferences(DependencyObject d, ResourcesChangeInfo info)
   at System.Windows.TreeWalkHelper.OnResourcesChanged(DependencyObject d, ResourcesChangeInfo info, Boolean raiseResourceChangedEvent)
   at System.Windows.TreeWalkHelper.OnResourcesChangedCallback(DependencyObject d, ResourcesChangeInfo info)
   at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
   at System.Windows.TreeWalkHelper.InvalidateOnResourcesChange(FrameworkElement fe, FrameworkContentElement fce, ResourcesChangeInfo info