wip billing

vnext
Paul Schneider 8 years ago
parent 640dd33b25
commit 4f948c5df7
4 changed files with 27 additions and 25 deletions

@ -63,12 +63,12 @@
<Entry.Behaviors>
<behaviors:DecimalValidatorBehavior x:Name="unitCostValidator" />
</Entry.Behaviors>
<Image x:Name="unitaryCostSuccessErrorImage"
Style="{Binding Source={x:Reference unitCostValidator},
</Entry>
<Label Text="€" Style="{StaticResource BigLabel}" />
<Image x:Name="unitaryCostSuccessErrorImage"
Style="{Binding Source={x:Reference unitCostValidator},
Path=IsValid,
Converter={StaticResource boolToStyleImage}}" />
</Entry>
<Label Text="€" Style="{StaticResource BigLabel}" HorizontalTextAlignment="Start"/>
</StackLayout>
<Button Text="Valider cette ligne de facture" Command="{Binding ValidateCommand}"
Clicked="OnValidateClicked"></Button>

@ -1,10 +1,5 @@
using BookAStar.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Forms;
namespace BookAStar.Pages
@ -15,10 +10,11 @@ namespace BookAStar.Pages
{
BindingContext = model;
InitializeComponent();
}
}
public void OnValidateClicked (object sender, EventArgs e)
{
OnBackButtonPressed();
this.Navigation.PopAsync();
}
}
}

@ -58,7 +58,6 @@ namespace BookAStar.ViewModels
{
SetProperty<decimal>(ref unitaryCost, value, "UnitaryCost");
data.UnitaryCost = value;
UnitaryCostText = value.ToString(unitCostFormat, CultureInfo.InvariantCulture);
}
}
protected int durationValue;
@ -107,20 +106,9 @@ namespace BookAStar.ViewModels
set
{
if (unitaryCostText != value)
{
try
{
data.UnitaryCost = decimal.Parse(value, CultureInfo.InvariantCulture);
}
catch (Exception)
{
// TODO Error model
// UI should shoud entry as wearing a wrong value
// thanks to its `Behaviors`
}
}
SetProperty<string>(ref unitaryCostText, value, "UnitaryCostText");
// TODO update behavior
}
}
bool invalidCost;

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace BookAStar.Views
{
public partial class CommandLineEditor : ContentView
{
public CommandLineEditor()
{
InitializeComponent();
}
}
}
Loading…