I'm creating a solution where I should display an integer in a <Label />
. To do this I'm using the code below:
public partial class Home : ContentPage {
public Home() {
InitializeComponent();
BindingContext = this;
Mockup();
}
private int Foo { get; set; }
private void Mockup() {
Foo = 10;
}
}
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Test.Home">
<ContentPage.Content>
<Label Text="{Binding Foo, Mode=TwoWay } />
</ContentPage.Content>
</ContentPage>
I need my text to always have an 8-digit mask. How do I apply the mask to the StringFormat
property so that the displayed value is 00000010
?