@ -2,9 +2,11 @@
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="BookAStar.Pages.EditEstimatePage"
x:Class="BookAStar.Pages.EditEstimatePage"
xmlns:converters="clr-namespace:BookAStar.Converters;assembly=BookAStar"
xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar"
xmlns:views="clr-namespace:BookAStar.Views;assembly=BookAStar"
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
xmlns:local="clr-namespace:BookAStar;assembly=BookAStar"
xmlns:behaviors="clr-namespace:BookAStar.Behaviors;assembly=BookAStar"
xmlns:behaviors="clr-namespace:BookAStar.Behaviors;assembly=BookAStar"
xmlns:extensions="clr-namespace:BookAStar.Extensions;assembly=BookAStar"
Style="{StaticResource PageStyle}">
Style="{StaticResource PageStyle}">
<ContentPage.Resources>
<ContentPage.Resources>
<ResourceDictionary>
<ResourceDictionary>
@ -14,14 +16,32 @@
<Style TargetType="Button">
<Style TargetType="Button">
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
<Setter Property="Style" Value="{StaticResource ButtonStyle}" />
</Style>
</Style>
<converters:BooleanToObjectConverter x:Key="boolToStyleImage" x:TypeArguments="Style">
<converters:BooleanToObjectConverter.FalseObject>
<Style TargetType="Image">
<Setter Property="HeightRequest" Value="20" />
<Setter Property="Source"
Value="{extensions:ImageResource BookAStar.Images.Validation.error.png}" />
</Style>
</converters:BooleanToObjectConverter.FalseObject>
<converters:BooleanToObjectConverter.TrueObject>
<Style TargetType="Image">
<Setter Property="HeightRequest" Value="20" />
<Setter Property="Source"
Value="{extensions:ImageResource BookAStar.Images.Validation.success.png}" />
</Style>
</converters:BooleanToObjectConverter.TrueObject>
</converters:BooleanToObjectConverter>
</ResourceDictionary>
</ResourceDictionary>
</ContentPage.Resources>
</ContentPage.Resources>
<ContentPage.Content>
<ContentPage.Content>
<ScrollView>
<StackLayout Padding="10,10,10,10" x:Name="mainLayout">
<StackLayout Padding="10,10,10,10" x:Name="mainLayout">
<Grid MinimumHeightRequest="12">
<Grid HeightRequest="120 ">
<Grid.RowDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="2 *" />
</Grid.RowDefinitions>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
@ -35,9 +55,7 @@
<Entry Placeholder="Saisissez un titre pour ce devis" Text="{Binding Title, Mode=TwoWay}" />
<Entry Placeholder="Saisissez un titre pour ce devis" Text="{Binding Title, Mode=TwoWay}" />
<views:MarkdownView x:Name="mdview"
<views:MarkdownView x:Name="mdview"
Editable="True"
Editable="True"
HorizontalOptions="FillAndExpand"
Markdown="{Binding Description, Mode=TwoWay}">
Markdown="{Binding Description, Mode=TwoWay}"
VerticalOptions="Start" >
<views:MarkdownView.Behaviors>
<views:MarkdownView.Behaviors>
<behaviors:MarkdownViewLengthValidator x:Name="descriptionLenValidator" MaxLength="512" MinLength="3" />
<behaviors:MarkdownViewLengthValidator x:Name="descriptionLenValidator" MaxLength="512" MinLength="3" />
@ -45,13 +63,12 @@
</views:MarkdownView>
</views:MarkdownView>
<StackLayout x:Name="biAnVaLayout">
<StackLayout x:Name="biAnVaLayout">
<ListView x:Name="BillListView" ItemsSource="{Binding Bill}"
<ListView x:Name="BillListView" ItemsSource="{Binding Bill}"
MinimumHeightRequest="40" HasUnevenRows="true" VerticalOptions="FillAndExpand"
HasUnevenRows="true" ItemTapped="OnEditLine">
HeightRequest="40" ItemTapped="OnEditLine">
<ListView.ItemTemplate>
<ListView.ItemTemplate>
<DataTemplate >
<DataTemplate >
<ViewCell>
<ViewCell>
<ViewCell.View>
<ViewCell.View Padding="5,5,5,5" >
<Grid MinimumHeightRequest="12" >
<Grid>
<Grid.RowDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
</Grid.RowDefinitions>
@ -60,6 +77,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="30" />
<ColumnDefinition Width="30" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="90" />
<ColumnDefinition Width="16" />
</Grid.ColumnDefinitions>
</Grid.ColumnDefinitions>
<Label Text="{Binding Description}"
<Label Text="{Binding Description}"
Grid.Row="0" Grid.Column="0" ></Label>
Grid.Row="0" Grid.Column="0" ></Label>
@ -70,6 +88,9 @@
<Label Text="{Binding UnitaryCost}"
<Label Text="{Binding UnitaryCost}"
Grid.Row="0" Grid.Column="3"
Grid.Row="0" Grid.Column="3"
FontFamily="Monospace"></Label>
FontFamily="Monospace"></Label>
<Image Grid.Row="0" Grid.Column="4" Style="{Binding
Path=ViewModelState.IsValid,
Converter={StaticResource boolToStyleImage}}" ></Image>
</Grid>
</Grid>
</ViewCell.View>
</ViewCell.View>
</ViewCell>
</ViewCell>
@ -83,6 +104,5 @@
</StackLayout>
</StackLayout>
</StackLayout>
</StackLayout>
</StackLayout>
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage.Content>
</ContentPage>
</ContentPage>