diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-22 11:58:11 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-08-22 11:58:11 +0300 |
| commit | 0c97dba8c1443ee39029136c52bc3861702888e2 (patch) | |
| tree | 0eba2c6e9a170bb316045f67add60060734d4f0d /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs | |
| parent | 884fce5075ca6a53cb5687feb0b01c6db0802f06 (diff) | |
| download | Tango-0c97dba8c1443ee39029136c52bc3861702888e2.tar.gz Tango-0c97dba8c1443ee39029136c52bc3861702888e2.zip | |
Added cartridge insertion validation handling.
Implemented a better keep alive mechanism.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs')
3 files changed, 132 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/CartridgeValidationView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/CartridgeValidationView.xaml new file mode 100644 index 000000000..e0c7ccbb6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/CartridgeValidationView.xaml @@ -0,0 +1,67 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.CartridgeValidationView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" + xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" + xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="570" Height="700" d:DataContext="{d:DesignInstance Type=local:CartridgeValidationViewVM, IsDesignTimeCreatable=False}"> + + <Grid Margin="20"> + <DockPanel> + <Grid DockPanel.Dock="Bottom"> + <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">CANCEL</touch:TouchButton> + <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">CONFIRM</touch:TouchButton> + </Grid> + <StackPanel DockPanel.Dock="Top"> + <Image Source="/Images/cartridge_validation.png" RenderOptions.BitmapScalingMode="Fant" Stretch="Uniform" Height="120"></Image> + <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Validate Cartridge Type</TextBlock> + <TextBlock Margin="20 10" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> + Ink cartridge has been inserted to the system. Please validate the cartridge ink by selecting the correct color. + </TextBlock> + </StackPanel> + <Grid> + <touch:TouchStaticListBox HorizontalAlignment="Center" VerticalAlignment="Center" ItemsSource="{Binding IDSPacks}" SelectedItem="{Binding SelectedIDSPack}"> + <touch:TouchStaticListBox.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel /> + </ItemsPanelTemplate> + </touch:TouchStaticListBox.ItemsPanel> + <touch:TouchStaticListBox.ItemContainerStyle> + <Style TargetType="touch:TouchStaticListBoxItem"> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="IsSelected" Value="True"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1.2" ScaleY="1.2"></ScaleTransform> + </Setter.Value> + </Setter> + </Trigger> + </Style.Triggers> + </Style> + </touch:TouchStaticListBox.ItemContainerStyle> + <touch:TouchStaticListBox.ItemTemplate> + <DataTemplate DataType="{x:Type entities:IdsPack}"> + <StackPanel Margin="15" Width="70"> + <Ellipse Width="70" Height="70"> + <Ellipse.Fill> + <SolidColorBrush Color="{Binding LiquidType.Color,Converter={StaticResource ColorToIntegerConverter}}"></SolidColorBrush> + </Ellipse.Fill> + </Ellipse> + <TextBlock Text="{Binding LiquidType.Name}" TextWrapping="Wrap" HorizontalAlignment="Center" Margin="0 10 0 0"></TextBlock> + </StackPanel> + </DataTemplate> + </touch:TouchStaticListBox.ItemTemplate> + </touch:TouchStaticListBox> + </Grid> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/CartridgeValidationView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/CartridgeValidationView.xaml.cs new file mode 100644 index 000000000..dbfb990b6 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/CartridgeValidationView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.UI.Dialogs +{ + /// <summary> + /// Interaction logic for TechnicianModeLoginView.xaml + /// </summary> + public partial class CartridgeValidationView : UserControl + { + public CartridgeValidationView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/CartridgeValidationViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/CartridgeValidationViewVM.cs new file mode 100644 index 000000000..f901723a4 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/CartridgeValidationViewVM.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class CartridgeValidationViewVM : DialogViewVM + { + private List<IdsPack> _idsPacks; + public List<IdsPack> IDSPacks + { + get { return _idsPacks; } + set { _idsPacks = value; RaisePropertyChangedAuto(); } + } + + private IdsPack _selectedIDSPack; + public IdsPack SelectedIDSPack + { + get { return _selectedIDSPack; } + set { _selectedIDSPack = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public CartridgeValidationViewVM() + { + IDSPacks = new List<IdsPack>(); + } + + protected override bool CanOK() + { + return base.CanOK() && SelectedIDSPack != null; + } + } +} |
