I have a custom User Control as to utilized FontAwesome fonts on the app, and it works correctly.
I want to style the control with Style in the ResourceDictionary in App.xaml.
The page utilizing the style is:
<StackLayout x:Name="TopStack">
<Grid VerticalOptions="FillAndExpand" BackgroundColor="#012c50" HeightRequest="200">
<Image Source="{local:ImageResource AAAApp.Images.navbartop.png}" Aspect="AspectFill" />
<userControls:FontAwesomeLabel Text="{x:Static userControls:Icon.FAUserCircle}" Style="{StaticResource SideMenuNameIcon}" />
<userControls:FontAwesomeLabel Text="{x:Static userControls:Icon.FAChevronRight}" />
<Label Text="Name Here" Style="{StaticResource SideMenuName}" />
<Label Text="1234567891231" Style="{StaticResource SideMenuAccount}" />
</Grid>
</StackLayout>
Please notice that Styles work correctly on the regular labels - green arrow.
When I run the application, I get the following error:
So I figure out the issue is with the TargetType in the style.
However, I have tried:
- TargetType="Label">
- TargetType="Label.FontFamily"
- TargetType="FontFamily">
- TargetType="userControls:FontAwesomeLabel">
- TargetType="userControls">
- TargetType="FontAwesomeLabel">
With the same results.
What am I missing?
Thanks!