[Unity] Style-Inheritance
Posted: 07 Sep 2014, 20:02
Hello,
a few days ago I stumbled over another problem. This time with style inheritance from resource dictionaries that doesn't seem to work. First I thought the problem was that Noesis doesn't support deriving from a default (target-type/ key-less) style. So I gave the style a certain key but that still didn't solve the problem as it was saying:
1. Define the default style in a shared resource dictionary.
2. Define the explicit style in the xaml (UserControl) where you're going to use the style.
So above does work when both styles are defined in either the resource dictionary or in the UserControl-xaml. But it doesn't work if one style is defined in the resource dictionary and the other one is defined in the UserControl-xaml.
a few days ago I stumbled over another problem. This time with style inheritance from resource dictionaries that doesn't seem to work. First I thought the problem was that Noesis doesn't support deriving from a default (target-type/ key-less) style. So I gave the style a certain key but that still didn't solve the problem as it was saying:
Eventually I figured that the problem occured only in the following scenario:Parsing StaticResource (@117,3).
Resource 'DefaultButtonStyle' not found
1. Define the default style in a shared resource dictionary.
2. Define the explicit style in the xaml (UserControl) where you're going to use the style.
Code: Select all
<Style x:Key="DefaultButtonStyle" TargetType="Button">
...
</Style>
<Style x:Key="ToolButtonStyle" TargetType="Button" BasedOn="{StaticResource DefaultButtonStyle}">
</Style>