Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Inherited styles in XAML ResourceDictionary

$
0
0

Hi Guys,
I'm having issues with Styles in a ResourceDictionary. I have a Basic style that is applied for an interface and works correctly, I'm then trying to extend this style for a CustomLabel (that inherits from the interface). The extended style is applied correctly but the original basic style seems to be lost. I'm wondering if there's anything I'm missing here?


<Style x:Key="BasicStyle" TargetType="controls:IMyInterface">
    <Setter Property="Label.FontFamily" Value="Arial" />
    <Setter Property="Label.FontSize" Value="32" />
    <Setter Property="Label.FontAttributes" Value="Bold" />
</Style>

<Style x:Key="ExtendedStyle" TargetType="controls:MyLabel" BaseResourceKey="BasicStyle">
    <Setter Property="Text" Value="TEST" />
    <Setter Property="TextColor" Value="Red" />
</Style>

Thanks in advance,
Paul


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>