I have recently updated to very latest Xamarin forms pre release 4.2 version. One notable breaking change I have encounter is - Say I have the following Style:
<Style x:Key="LightTextLabelStyle" TargetType="Label">
<Setter Property="FontFamily" Value="{StaticResource TextLight}" />
<Setter Property="FontSize" Value="15" />
<Setter Property="TextColor" Value="{StaticResource greyishBrown}" />
</Style>
In previous versions, same target "Label" was supported for both Span and Labels. Like - this was working before:
<Label Margin="0,6,0,0">
<Label.FormattedText>
<FormattedString>
<Span Text="{Binding PriceText}" Style="{StaticResource LightTextLabelStyle}" FontSize="13" />
<Span Text="{Binding BidAmount, StringFormat=' {0:C0}' TargetNullValue=' Pending'}" Style="{StaticResource LightTextLabelStyle}" FontSize="13" />
</FormattedString>
</Label.FormattedText>
</Label>
Same style targeted for Label was support on Span as well. However now in new version it doesn't.
My Question is: Can we support Both Label and Span with same style? Can we not target same style for both? Like I tried the following but it doesn't compile:
<Style x:Key="LightTextLabelStyle" TargetType="Label, Span">
<Setter Property="FontFamily" Value="{StaticResource TextLight}" />
<Setter Property="FontSize" Value="15" />
<Setter Property="TextColor" Value="{StaticResource greyishBrown}" />
</Style>
Please help me. I can copy paste the style and make 2 different styles however; if there's a some better way?