Skip to main content

Microsoft Silverlight

ImplicitStyleManager doesnt work for local typesRSS Feed

(0)

maxima120
maxima120

Member

Member

88 points

85 Posts

ImplicitStyleManager doesnt work for local types

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);

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities