a chat page
This commit is contained in:
parent
e2c9090048
commit
ea5e36ec7b
4 changed files with 27 additions and 10 deletions
|
|
@ -47,6 +47,7 @@
|
||||||
<Compile Include="Behaviors\StarBehavior.cs" />
|
<Compile Include="Behaviors\StarBehavior.cs" />
|
||||||
<Compile Include="Constants.cs" />
|
<Compile Include="Constants.cs" />
|
||||||
<Compile Include="Converters\BooleanToObjectConverter.cs" />
|
<Compile Include="Converters\BooleanToObjectConverter.cs" />
|
||||||
|
<Compile Include="Converters\EnumConverter.cs" />
|
||||||
<Compile Include="Converters\GenderConverter.cs" />
|
<Compile Include="Converters\GenderConverter.cs" />
|
||||||
<Compile Include="Converters\RatingText.cs" />
|
<Compile Include="Converters\RatingText.cs" />
|
||||||
<Compile Include="Extensions\ImageResourceExtension.cs" />
|
<Compile Include="Extensions\ImageResourceExtension.cs" />
|
||||||
|
|
@ -143,7 +144,7 @@
|
||||||
<Compile Include="ViewModels\BillingLineViewModel.cs" />
|
<Compile Include="ViewModels\BillingLineViewModel.cs" />
|
||||||
<Compile Include="ViewModels\ChatViewModel.cs" />
|
<Compile Include="ViewModels\ChatViewModel.cs" />
|
||||||
<Compile Include="ViewModels\DashboardViewModel.cs" />
|
<Compile Include="ViewModels\DashboardViewModel.cs" />
|
||||||
<Compile Include="ViewModels\EstimateViewModel.cs" />
|
<Compile Include="ViewModels\EditEstimateViewModel.cs" />
|
||||||
<Compile Include="ViewModels\UserLoginViewModel.cs" />
|
<Compile Include="ViewModels\UserLoginViewModel.cs" />
|
||||||
<Compile Include="ViewModels\ViewModelBase.cs" />
|
<Compile Include="ViewModels\ViewModelBase.cs" />
|
||||||
<Compile Include="Views\MarkdownView.cs" />
|
<Compile Include="Views\MarkdownView.cs" />
|
||||||
|
|
|
||||||
|
|
@ -63,12 +63,12 @@
|
||||||
<Entry.Behaviors>
|
<Entry.Behaviors>
|
||||||
<behaviors:DecimalValidatorBehavior x:Name="unitCostValidator" />
|
<behaviors:DecimalValidatorBehavior x:Name="unitCostValidator" />
|
||||||
</Entry.Behaviors>
|
</Entry.Behaviors>
|
||||||
</Entry>
|
<Image x:Name="unitaryCostSuccessErrorImage"
|
||||||
<Label Text="€" Style="{StaticResource BigLabel}" />
|
Style="{Binding Source={x:Reference unitCostValidator},
|
||||||
<Image x:Name="unitaryCostSuccessErrorImage"
|
|
||||||
Style="{Binding Source={x:Reference unitCostValidator},
|
|
||||||
Path=IsValid,
|
Path=IsValid,
|
||||||
Converter={StaticResource boolToStyleImage}}" />
|
Converter={StaticResource boolToStyleImage}}" />
|
||||||
|
</Entry>
|
||||||
|
<Label Text="€" Style="{StaticResource BigLabel}" HorizontalTextAlignment="Start"/>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
<Button Text="Valider cette ligne de facture" Command="{Binding ValidateCommand}"
|
<Button Text="Valider cette ligne de facture" Command="{Binding ValidateCommand}"
|
||||||
Clicked="OnValidateClicked"></Button>
|
Clicked="OnValidateClicked"></Button>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
using BookAStar.ViewModels;
|
using BookAStar.ViewModels;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Input;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace BookAStar.Pages
|
namespace BookAStar.Pages
|
||||||
|
|
@ -11,10 +16,9 @@ namespace BookAStar.Pages
|
||||||
BindingContext = model;
|
BindingContext = model;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnValidateClicked (object sender, EventArgs e)
|
public void OnValidateClicked (object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
this.Navigation.PopAsync();
|
OnBackButtonPressed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ namespace BookAStar.ViewModels
|
||||||
{
|
{
|
||||||
SetProperty<decimal>(ref unitaryCost, value, "UnitaryCost");
|
SetProperty<decimal>(ref unitaryCost, value, "UnitaryCost");
|
||||||
data.UnitaryCost = value;
|
data.UnitaryCost = value;
|
||||||
|
UnitaryCostText = value.ToString(unitCostFormat, CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected int durationValue;
|
protected int durationValue;
|
||||||
|
|
@ -106,9 +107,20 @@ namespace BookAStar.ViewModels
|
||||||
|
|
||||||
set
|
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");
|
SetProperty<string>(ref unitaryCostText, value, "UnitaryCostText");
|
||||||
// TODO update behavior
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool invalidCost;
|
bool invalidCost;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue