Merge branch 'vnext' of github.com:pazof/yavsc into vnext

This commit is contained in:
2017-01-12 10:12:36 +01:00
8 changed files with 42 additions and 22 deletions

View File

@ -63,7 +63,7 @@
<Setter Property="HorizontalOptions" Value="FillAndExpand" />
</Style>
<Style x:Key="BigLabel" BasedOn="{StaticResource LabelStyle}" TargetType="Label">
<Style x:Key="BigLabelStyle" BasedOn="{StaticResource LabelStyle}" TargetType="Label">
<Setter Property="FontSize" Value="Large" />
</Style>
<Style x:Key="ContentLabelStyle" BasedOn="{StaticResource LabelStyle}" TargetType="Label">

View File

@ -29,6 +29,8 @@
internal LocalEntity<BillingLine, string> EstimateLinesTemplates { get; set; }
internal LocalEntity<ChatMessage, int> PrivateMessages { get; set; }
internal LocalEntity<PageState, int> AppState { get; set; }
internal LocalEntity<string,string> ClientSignatures { get; set; }
internal LocalEntity<string, string> ProviderSignatures { get; set; }
protected static DataManager instance = new DataManager();

View File

@ -9,7 +9,6 @@ namespace BookAStar.Model.Workflow
using Data;
using Interfaces;
using Social;
public partial class Estimate : IEstimate
{
public long Id { get; set; }
@ -28,6 +27,7 @@ namespace BookAStar.Model.Workflow
/// <returns></returns>
public List<string> AttachedGraphics { get; set; }
[JsonIgnore]
// form in db
public string AttachedGraphicsString
{
get { return AttachedGraphics==null?null:string.Join(":", AttachedGraphics); }
@ -41,6 +41,7 @@ namespace BookAStar.Model.Workflow
/// </summary>
/// <returns></returns>
public List<string> AttachedFiles { get; set; }
// form in db
[JsonIgnore]
public string AttachedFilesString
{
@ -92,12 +93,12 @@ namespace BookAStar.Model.Workflow
}
}
/// <summary>
/// This validation comes from the provider.
/// As long as it's an estimate, no client validation
/// is formaly needed
/// This validation comes first from the provider.
/// </summary>
public DateTime ProviderValidationDate { get; set; }
/// <summary>
/// Date for the agreement from the client
/// </summary>
public DateTime ClientApprouvalDate { get; set; }
}

View File

@ -102,7 +102,7 @@
<behaviors:DecimalValidatorBehavior x:Name="unitCostValidator" />
</Entry.Behaviors>
</Entry>
<Label Text="€" Style="{StaticResource BigLabel}" />
<Label Text="€" Style="{StaticResource BigLabelStyle}" />
<Image x:Name="unitaryCostSuccessErrorImage"
Style="{Binding Source={x:Reference unitCostValidator},
Path=IsValid,

View File

@ -5,7 +5,16 @@
xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar"
x:Class="BookAStar.Pages.EstimatePages.EstimateSigningPage">
<ContentPage.Resources>
<ResourceDictionary>
<Style TargetType="Label">
<Setter Property="Style" Value="{StaticResource ContentLabelStyle}" />
</Style>
<Style TargetType="Button">
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
</Style>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<StackLayout Padding="10,10,10,10" x:Name="mainLayout">
<ScrollView>
@ -20,11 +29,11 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Text="{Binding Client.UserName}" ></Label>
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Query.Location.Address}" ></Label>
<Label Grid.Row="0" Grid.Column="1" Text="{Binding Query.Location.Address}" ></Label>
<Label Grid.Row="0" Grid.Column="2" Text="{Binding Query.EventDate, StringFormat='{0:dddd d MMMM yyyy à hh:mm}'}" ></Label>
</Grid>
<Label Text="{Binding Title}" />
<Label Text="{Binding Title}" Style="{StaticResource BigLabelStyle}" />
<views:MarkdownView x:Name="mdview"
HorizontalOptions="FillAndExpand"
@ -63,13 +72,17 @@
</ListView.ItemTemplate>
</ListView>
<Label FormattedText="{Binding FormattedTotal}"/>
<StackLayout Orientation="Horizontal">
<Image Source="{Binding ProSignImage}" HorizontalOptions="Start"></Image>
<Image Source="{Binding CliSignImage}" HorizontalOptions="End"></Image>
</StackLayout>
</StackLayout>
</ScrollView>
<signature:SignaturePadView x:Name="padView"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
BackgroundColor="White"
CaptionText="Caption This" CaptionTextColor="Black"
CaptionText="{Binding Data.Owner.UserName}" CaptionTextColor="Black"
ClearText="Effacer!" ClearTextColor="Red"
PromptText="Prompt Here" PromptTextColor="Red"
SignatureLineColor="Aqua" StrokeColor="Black" StrokeWidth="2" />

View File

@ -41,17 +41,7 @@ namespace BookAStar.Pages.EstimatePages
ParentValidationCommand.Execute(true);
}
private async void OnGetStats(object sender, EventArgs e)
{
var points = padView.Points.ToArray();
using (var image = await padView.GetImageStreamAsync(SignatureImageFormat.Png))
{
var pointCount = points.Count();
var imageSize = image.Length / 1000;
var linesCount = points.Count(p => p == Point.Zero) + (points.Length > 0 ? 1 : 0);
await DisplayAlert("Stats", $"The signature has {linesCount} lines or {pointCount} points, and is {imageSize:#,###.0}KB (in memory) when saved as a PNG.", "Cool");
}
}
private async void OnChangeTheme(object sender, EventArgs e)
{
var action = await DisplayActionSheet("Change Theme", "Cancel", null, "White", "Black", "Aqua");

View File

@ -50,6 +50,7 @@ namespace BookAStar.ViewModels.EstimateAndBilling
NotifyPropertyChanged("Query");
NotifyPropertyChanged("CLient");
NotifyPropertyChanged("ModelState");
}
protected override void OnPropertyChanged(PropertyChangedEventArgs e)

View File

@ -10,5 +10,18 @@ namespace BookAStar.ViewModels.Signing
{
}
public Command<bool> ValidationCommand { get; set; }
public ImageSource ProSignImage {
get
{
return new FileImageSource();
}
}
public ImageSource CliSignImage
{
get
{
return new FileImageSource();
}
}
}
}