Adding styles for custom elements
We still have one more addition to finalise the StockItemDetailsPage
. We are going to add a style for the CustomLabel
. Open up the App.xaml
file and add the following style:
<Style x:Key="CustomLabelStyle" TargetType="controls:CustomLabel"> <Setter Property="TextColor" Value="Black" /> <Setter Property="FontFamily" Value="Gravur-Condensed" /> <Setter Property="AndroidFontStyle" Value="GraCoRg_" /> </Style>
We have included a Setter
for the AndroidFontStyle
property we created earlier. Don't forget we must also add the namespace reference for the Controls
:
xmlns:controls="clr-namespace:Stocklist.XamForms.Controls;assembly=Stocklist.XamForms"
That's everything for the user interface. Now let's move on to implementing the view-model for the StockItemDetailsPage
.