I ran into a problem when I decided to move a custom control from the apps into the common library. I moved the custom control definition (MyCustomControl.cs) and the Theme/Generic.xaml, which contains the default style / template for my control.
In one of the applications, I was trying to further customize the default style by creating a style based on the default style:
<Style TargetType="common:MyCustomControl" BasedOn="{StaticResource {x:Type common:MyCustomControl}}"> ... </Style>
Solution:
It turned out I forgot to add the ThemeInfo assembly attribute, which defines where the themes are stored in the assembly. When I added the following in the AssemblyInfo.cs in my common library, the problem was solved:
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
Hiç yorum yok:
Yorum Gönder