balance binding
This commit is contained in:
@ -39,8 +39,9 @@
|
||||
<OnPlatform x:TypeArguments="x:String" Android=" "/>
|
||||
</TableSection.Title>
|
||||
<ui:OptionEntryCell Title="{r:Text Balance}" Height="44" Icon="sackdollar.png"
|
||||
Text="{Binding Balance, Mode=TwoWay, Converter={StaticResource moneyConverter}}"
|
||||
Keyboard="Numeric" Placeholder="{r:Text BalancePlaceholder}"/>
|
||||
Text="{Binding Balance, Converter={StaticResource moneyConverter}}"
|
||||
Keyboard="Numeric" Placeholder="{r:Text BalancePlaceholder}"
|
||||
Unfocused="Balance_Unfocused"/>
|
||||
<ui:OptionTextCell Title="{r:Text Currency}" Height="44" Icon="dollar.png"
|
||||
Detail="{r:Text CNY}"/>
|
||||
</TableSection>
|
||||
|
@ -69,6 +69,16 @@ namespace Billing.Views
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Balance_Unfocused(object sender, FocusEventArgs e)
|
||||
{
|
||||
if (sender is OptionEntry entry && decimal.TryParse(entry.Text, out decimal d))
|
||||
{
|
||||
var converter = (MoneyConverter)Resources["moneyConverter"];
|
||||
entry.Text = converter.Convert(d, null, null, null)?.ToString();
|
||||
//Balance = d;
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnCheckAccount()
|
||||
{
|
||||
if (Tap.IsBusy)
|
||||
|
Reference in New Issue
Block a user