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

Can I set multiple styles to an element?

$
0
0

I tried with comma:

<ContentPage.Resources>
    <ResourceDictionary>
        <Style x:Key="large" TargetType="Label">
            <Setter Property="FontSize" Value="Large" />
        </Style>
        <Style x:Key="red" TargetType="Label">
            <Setter Property="TextColor" Value="Red" />
        </Style>
    </ResourceDictionary>
</ContentPage.Resources>

<StackLayout>
    <Label Style="{StaticResource large, red}" Text="large red text" />
</StackLayout>

But only the red style was applied.
It seems like later one override the others.
Can I use two or more styles simultaneously?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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