Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit ImplicitStyleManager doesnt work for local types
0 replies. Latest Post by maxima120 on July 3, 2009.
(0)
maxima120
Member
88 points
85 Posts
07-03-2009 9:19 AM |
I have made my own button and am trying to apply themes using ImplicitStyleManager but it doesnt show up (UI doesnt change). Please help.
XAML:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:TemplatePrototypes;assembly=TemplatePrototypes" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
<Style TargetType="local:Button1">
....
C#:
public class Button1 : Button { }
...
Uri uri = new Uri(resourcePath, UriKind.Relative); ImplicitStyleManager.SetResourceDictionaryUri(this, uri); ImplicitStyleManager.SetApplyMode(this, ImplicitStylesApplyMode.Auto); ImplicitStyleManager.Apply(this);