|
@@ -3,8 +3,104 @@
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
xmlns:modules="clr-namespace:PRS.Avalonia.Modules"
|
|
|
+ xmlns:avalonia="clr-namespace:PRS.Avalonia"
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
|
x:Class="PRS.Avalonia.Modules.DeliveryListView"
|
|
|
- x:DataType="modules:DeliveryScannerViewModel">
|
|
|
- Welcome to Avalonia!
|
|
|
+ x:DataType="modules:DeliveryListViewModel">
|
|
|
+
|
|
|
+ <UserControl.Resources>
|
|
|
+
|
|
|
+ <modules:DeliveryColorConverter x:Key="DeliveryBackgroundConverter" Delivered="DimGray" Booked="LightGreen" Due="LightGray" />
|
|
|
+ <modules:DeliveryColorConverter x:Key="DeliveryForegroundConverter" Delivered="WhiteSmoke" Booked="Black" Due="DimGray" />
|
|
|
+ <modules:DeliveryDescriptionConverter x:Key="DeliveryDescriptionConverter"/>
|
|
|
+ <modules:DeliveryAddressConverter x:Key="DeliveryAddressConverter"/>
|
|
|
+ <modules:DeliveryDateConverter x:Key="DeliveryDateConverter"/>
|
|
|
+ <modules:DeliveryStatusConverter x:Key="DeliveryStatusConverter"/>
|
|
|
+
|
|
|
+ <!-- Command="{Binding $parent[ItemsControl].((modules:DeliveryListViewModel)DataContext).SelectDeliveryCommand}" -->
|
|
|
+ <!-- CommandParameter="{Binding .}" -->
|
|
|
+ <!-- HorizontalContentAlignment="Stretch" -->
|
|
|
+
|
|
|
+ <DataTemplate
|
|
|
+ x:Key="DeliveryShellTemplate"
|
|
|
+ x:DataType="avalonia:DeliveryShell">
|
|
|
+
|
|
|
+ <Border
|
|
|
+ Margin="0,0,0,2"
|
|
|
+ Background="{Binding ., Converter={StaticResource DeliveryBackgroundConverter}}"
|
|
|
+
|
|
|
+ >
|
|
|
+ <Grid>
|
|
|
+
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="Auto" />
|
|
|
+ <ColumnDefinition Width="*" />
|
|
|
+ <ColumnDefinition Width="Auto" />
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="Auto"/>
|
|
|
+ <RowDefinition Height="Auto"/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+
|
|
|
+ <Label
|
|
|
+ Content="{Binding Number}"
|
|
|
+ Grid.Row="0"
|
|
|
+ Grid.Column="0"
|
|
|
+ FontSize="{StaticResource PrsFontSizeSmall}"
|
|
|
+ Foreground="{Binding ., Converter={StaticResource DeliveryForegroundConverter}}"
|
|
|
+ HorizontalContentAlignment="Center"/>
|
|
|
+
|
|
|
+ <TextBlock
|
|
|
+ Text="{Binding ., Converter={StaticResource DeliveryDescriptionConverter}}"
|
|
|
+ Grid.Row="0"
|
|
|
+ Grid.Column="1"
|
|
|
+ FontSize="{StaticResource PrsFontSizeSmall}"
|
|
|
+ Foreground="{Binding ., Converter={StaticResource DeliveryForegroundConverter}}"
|
|
|
+ TextTrimming="CharacterEllipsis"/>
|
|
|
+
|
|
|
+ <Label
|
|
|
+ Content="{Binding ., Converter={StaticResource DeliveryStatusConverter}}"
|
|
|
+ Grid.Row="0"
|
|
|
+ Grid.Column="2"
|
|
|
+ FontSize="{StaticResource PrsFontSizeSmall}"
|
|
|
+ Foreground="{Binding ., Converter={StaticResource DeliveryForegroundConverter}}"
|
|
|
+ HorizontalContentAlignment="Center"/>
|
|
|
+
|
|
|
+ <Label
|
|
|
+ Content="{Binding ., Converter={StaticResource DeliveryDateConverter}, StringFormat='{}{0:dd MMM yy}'}"
|
|
|
+ Grid.Row="1"
|
|
|
+ Grid.Column="2"
|
|
|
+ FontSize="{StaticResource PrsFontSizeSmall}"
|
|
|
+ Foreground="{Binding ., Converter={StaticResource DeliveryForegroundConverter}}"
|
|
|
+ HorizontalContentAlignment="Center"/>
|
|
|
+
|
|
|
+ <TextBlock
|
|
|
+ Text="{Binding ., Converter={StaticResource DeliveryAddressConverter}}"
|
|
|
+ Grid.Row="1"
|
|
|
+ Grid.Column="0"
|
|
|
+ Grid.ColumnSpan="2"
|
|
|
+ FontSize="{StaticResource PrsFontSizeExtraSmall}"
|
|
|
+ FontStyle="{StaticResource PrsFontStylItalic}"
|
|
|
+ Foreground="{Binding ., Converter={StaticResource DeliveryForegroundConverter}}"
|
|
|
+ LineHeight="1"
|
|
|
+ TextWrapping="Wrap"/>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ </DataTemplate>
|
|
|
+ </UserControl.Resources>
|
|
|
+
|
|
|
+
|
|
|
+ <ListBox x:Name="_listBox"
|
|
|
+ ItemsSource="{Binding Deliveries.Items}"
|
|
|
+ ItemTemplate="{StaticResource DeliveryShellTemplate}">
|
|
|
+ <ListBox.GestureRecognizers>
|
|
|
+ <PullGestureRecognizer PullDirection="TopToBottom" ></PullGestureRecognizer>
|
|
|
+ </ListBox.GestureRecognizers>
|
|
|
+ </ListBox>
|
|
|
+
|
|
|
+
|
|
|
</UserControl>
|