diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-05-27 16:46:30 +0300 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-05-27 16:46:30 +0300 |
| commit | 8fefb650921f35b2b72ae5d49d7adefe30bd8a6c (patch) | |
| tree | 0a0525e9865473f8b571390f9e7531df9acb9af4 /Software/Visual_Studio/PPC/Modules | |
| parent | ea1a4d93784b5110a59a3acbece767fd1e9078d8 (diff) | |
| parent | 56c56d443d7ebd5a9fbab098e8500390bfc0c7cc (diff) | |
| download | Tango-8fefb650921f35b2b72ae5d49d7adefe30bd8a6c.tar.gz Tango-8fefb650921f35b2b72ae5d49d7adefe30bd8a6c.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules')
8 files changed, 700 insertions, 617 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobsCategoryToOpacityConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobsCategoryToOpacityConverter.cs new file mode 100644 index 000000000..0eaad280a --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Converters/JobsCategoryToOpacityConverter.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using static Tango.PPC.Jobs.ViewModels.JobsViewVM; + +namespace Tango.PPC.Jobs.Converters +{ + public class JobsCategoryToOpacityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + JobsCategory selected = (JobsCategory)Enum.Parse(typeof(JobsCategory), parameter.ToString()); + JobsCategory category = (JobsCategory)value; + + return category.Equals(selected) ? 1 : 0; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index bbfef32fd..55983118d 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -170,6 +170,7 @@ </Compile> <Compile Include="Converters\ColorSpaceToImageConverter.cs" /> <Compile Include="Converters\ColorSpaceToVisibilityConverter.cs" /> + <Compile Include="Converters\JobsCategoryToOpacityConverter.cs" /> <Compile Include="Converters\JobProgressToPositionConverter.cs" /> <Compile Include="Converters\JobsCategoryToVisibilityConverter.cs" /> <Compile Include="Converters\JobToEmbroideryImageConverter.cs" /> @@ -231,6 +232,7 @@ <DependentUpon>Settings.settings</DependentUpon> <DesignTimeSharedInput>True</DesignTimeSharedInput> </Compile> + <Compile Include="ViewContracts\IJobsView.cs" /> <Compile Include="ViewContracts\IJobView.cs" /> <Compile Include="ViewModelLocator.cs" /> <Compile Include="ViewModels\JobProgressViewVM.cs" /> @@ -449,7 +451,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> + <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobsView.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobsView.cs new file mode 100644 index 000000000..7a8907c36 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewContracts/IJobsView.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.PPC.Common; + +namespace Tango.PPC.Jobs.ViewContracts +{ + public interface IJobsView : IPPCView + { + void ScrollToTop(); + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs index c89db820d..9862a4afb 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs @@ -33,6 +33,8 @@ using System.Windows.Media; using Tango.PMR.TCC; using Tango.Pulse; using System.Windows.Media.Imaging; +using Tango.Touch.Components; +using Tango.PPC.Jobs.ViewContracts; namespace Tango.PPC.Jobs.ViewModels { @@ -40,7 +42,7 @@ namespace Tango.PPC.Jobs.ViewModels /// Represents the jobs list view model. /// </summary> /// <seealso cref="Tango.PPC.Common.PPCViewModel" /> - public class JobsViewVM : PPCViewModel + public class JobsViewVM : PPCViewModel<IJobsView> { private ObservablesContext _db; //Holds the db context for the job list. @@ -132,7 +134,6 @@ namespace Tango.PPC.Jobs.ViewModels _selectedCategoryIndex = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(SelectedCategory)); - Filter = null; } } @@ -162,6 +163,14 @@ namespace Tango.PPC.Jobs.ViewModels set { _filter = value; RaisePropertyChangedAuto(); OnFilterChanged(); } } + private ICollectionFilter _collectionFilter; + public ICollectionFilter CollectionFilter + { + get { return _collectionFilter; } + set { _collectionFilter = value; RaisePropertyChangedAuto(); } + } + + #endregion #region Commands @@ -231,6 +240,28 @@ namespace Tango.PPC.Jobs.ViewModels RegisterForMessage<JobRemovedMessage>(HandleJobRemovedMessage); RegisterForMessage<JobSavedMessage>(HandleJobSavedMessage); RegisterForMessage<NavigatedToJobsModuleMessage>((x) => Filter = null); + + CollectionFilter = new DefaultCollectionFilter(); + CollectionFilter.RegisterFilter(item => + { + var job = item as Job; + + if (job != null) + { + if (String.IsNullOrEmpty(Filter)) + { + return true; + } + else + { + return (job.Name.ToLower().StartsWith(Filter) || (job.Customer != null && job.Customer.Name.ToLower().StartsWith(Filter))); + } + } + else + { + return true; + } + }); } #endregion @@ -326,15 +357,7 @@ namespace Tango.PPC.Jobs.ViewModels DraftJobsCollectionView.Filter = new Predicate<object>(x => { var job = x as Job; - - if (String.IsNullOrWhiteSpace(Filter)) - { - return job.JobStatus == JobStatuses.Draft; - } - else - { - return job.JobStatus == JobStatuses.Draft && (job.Name.ToLower().StartsWith(Filter) || (job.Customer != null && job.Customer.Name.ToLower().StartsWith(Filter))); - } + return job.JobStatus == JobStatuses.Draft; }); @@ -343,15 +366,7 @@ namespace Tango.PPC.Jobs.ViewModels HistoryJobsCollectionView.Filter = new Predicate<object>(x => { var job = x as Job; - - if (String.IsNullOrWhiteSpace(Filter)) - { - return job.JobStatus != JobStatuses.Draft; - } - else - { - return job.JobStatus != JobStatuses.Draft && (job.Name.ToLower().StartsWith(Filter) || (job.Customer != null && job.Customer.Name.ToLower().StartsWith(Filter))); - } + return job.JobStatus != JobStatuses.Draft; }); IsLoadingJobs = false; @@ -611,14 +626,8 @@ namespace Tango.PPC.Jobs.ViewModels { if (DraftJobsCollectionView != null && HistoryJobsCollectionView != null) { - if (SelectedCategory == JobsCategory.Draft) - { - DraftJobsCollectionView.Refresh(); - } - else if (SelectedCategory == JobsCategory.History) - { - HistoryJobsCollectionView.Refresh(); - } + CollectionFilter.RaiseFilterChanged(); + View.ScrollToTop(); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index 9448665d0..136644f5c 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -56,7 +56,7 @@ </ItemsControl> <Canvas VerticalAlignment="Bottom" Visibility="{Binding IsLiquidVolumesOutOfRange,Converter={StaticResource BooleanToVisibilityConverter}}"> - <controls:FastTextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Liquid volumes are out of range."></controls:FastTextBlock> + <TextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Liquid volumes are out of range."></TextBlock> </Canvas> </Grid> </DataTemplate> @@ -122,7 +122,7 @@ </StackPanel> <DockPanel LastChildFill="False" Margin="0 20 0 0"> - <controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Color code:</controls:FastTextBlock> + <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Color code:</TextBlock> <ContentControl Focusable="False" Margin="20 0 0 0" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="300" Content="{Binding}"> <ContentControl.Style> <Style TargetType="ContentControl"> @@ -179,129 +179,169 @@ </DataTemplate> <DataTemplate x:Key="Segment_Template" DataType="{x:Type entities:Segment}"> - <Border Margin="0 0 0 15" RenderOptions.EdgeMode="Unspecified" CornerRadius="8" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}"> - <Border.CacheMode> - <BitmapCache RenderAtScale="1" SnapsToDevicePixels="True" /> - </Border.CacheMode> - <!--<Border.Effect> + <touch:TouchVirtualizedContentControl Margin="0 0 0 15"> + <Border RenderOptions.EdgeMode="Unspecified" CornerRadius="8" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}"> + <Border.CacheMode> + <BitmapCache RenderAtScale="1" SnapsToDevicePixels="True" /> + </Border.CacheMode> + <!--<Border.Effect> <DropShadowEffect Opacity="0.5" Color="{StaticResource TangoDropShadowColor}" BlurRadius="10" ShadowDepth="15" /> </Border.Effect>--> - <Grid> - <Grid.RowDefinitions> - <RowDefinition Height="Auto" /> - <RowDefinition Height="Auto" /> - </Grid.RowDefinitions> - <Grid Background="Transparent" dragAndDrop:DragAndDropService.DropCommand="{Binding ElementName=view,Path=DataContext.SegmentDroppedCommand}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.Droppable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding ElementName=DraggingSurface}"> - <Grid.Style> - <Style TargetType="Grid"> - <Setter Property="Opacity" Value="1"></Setter> - <Style.Triggers> - <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> - <Setter Property="Opacity" Value="0.5"></Setter> - </Trigger> - </Style.Triggers> - </Style> - </Grid.Style> - <DockPanel> - <DockPanel.Style> - <Style TargetType="DockPanel"> - <Setter Property="Height" Value="163"></Setter> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid Background="Transparent" dragAndDrop:DragAndDropService.DropCommand="{Binding ElementName=view,Path=DataContext.SegmentDroppedCommand}" dragAndDrop:DragAndDropService.Draggable="True" dragAndDrop:DragAndDropService.Droppable="True" dragAndDrop:DragAndDropService.DraggingSurface="{Binding ElementName=DraggingSurface}"> + <Grid.Style> + <Style TargetType="Grid"> + <Setter Property="Opacity" Value="1"></Setter> <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked,IsAsync=True}" Value="True"> - <Setter Property="Height" Value="74"></Setter> - </DataTrigger> + <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + </Trigger> </Style.Triggers> </Style> - </DockPanel.Style> - <Border DockPanel.Dock="Left" Background="{Binding SegmentBrush}" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoLightBorderBrush}"> - <Border.Style> - <Style TargetType="Border"> - <Setter Property="CornerRadius" Value="8 0 0 8"></Setter> - <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,IsAsync=True}"></Setter> + </Grid.Style> + <DockPanel> + <DockPanel.Style> + <Style TargetType="DockPanel"> + <Setter Property="Height" Value="163"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked,IsAsync=True}" Value="True"> - <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,Converter={StaticResource MathOperatorConverter},ConverterParameter='*2',IsAsync=True}"></Setter> + <Setter Property="Height" Value="74"></Setter> </DataTrigger> - <MultiDataTrigger> - <MultiDataTrigger.Conditions> - <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="True"></Condition> - <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True"></Condition> - </MultiDataTrigger.Conditions> - <Setter Property="CornerRadius" Value="8 0 0 0"></Setter> - </MultiDataTrigger> </Style.Triggers> </Style> - </Border.Style> - </Border> + </DockPanel.Style> + <Border DockPanel.Dock="Left" Background="{Binding SegmentBrush}" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoLightBorderBrush}"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="CornerRadius" Value="8 0 0 8"></Setter> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,IsAsync=True}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked,IsAsync=True}" Value="True"> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,Converter={StaticResource MathOperatorConverter},ConverterParameter='*2',IsAsync=True}"></Setter> + </DataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="True"></Condition> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="CornerRadius" Value="8 0 0 0"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + </Border> - <Grid> - <DockPanel Margin="30 0" VerticalAlignment="Center"> - <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> - <Canvas Visibility="{Binding HasOutOfGamutBrushStop,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}"> - <Image Canvas.Left="-25" Canvas.Top="1" Source="{StaticResource Image_Out_Of_Gamut}" Width="19" Height="19" /> - </Canvas> - <TextBlock FontSize="{StaticResource TangoTitleFontSize}"> + <Grid> + <DockPanel Margin="30 0" VerticalAlignment="Center"> + <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> + <Canvas Visibility="{Binding HasOutOfGamutBrushStop,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}"> + <Image Canvas.Left="-25" Canvas.Top="1" Source="{StaticResource Image_Out_Of_Gamut}" Width="19" Height="19" /> + </Canvas> + <TextBlock FontSize="{StaticResource TangoTitleFontSize}"> <Run>Segment #</Run> <Run Text="{Binding SegmentIndex,Mode=OneWay,IsAsync=True}"></Run> - </TextBlock> - </StackPanel> + </TextBlock> + </StackPanel> - <StackPanel Margin="0 30 0 0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="300" Visibility="{Binding ElementName=toggle_large_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}"> - <DockPanel LastChildFill="False"> - <DockPanel.Style> - <Style TargetType="DockPanel"> - <Setter Property="Visibility" Value="Visible"></Setter> + <StackPanel Margin="0 30 0 0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="300" Visibility="{Binding ElementName=toggle_large_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}"> + <DockPanel LastChildFill="False"> + <DockPanel.Style> + <Style TargetType="DockPanel"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="True"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </DockPanel.Style> + <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Color code:"></TextBlock> + + <Grid DockPanel.Dock="Right" DataContext="{Binding BrushStops[0],IsAsync=True}"> + <StackPanel> + <ContentControl Focusable="False" FocusVisualStyle="{x:Null}" d:DataContext="{d:DesignInstance Type=entities:BrushStop, IsDesignTimeCreatable=False}" Content="{Binding}" Width="180"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + + </DataTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="RGB"> + <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="CMYK"> + <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="LAB"> + <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Twine"> + <Setter Property="ContentTemplate" Value="{StaticResource TWINE_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Volume"> + <Setter Property="ContentTemplate" Value="{StaticResource Volume_Template}" /> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </StackPanel> + </Grid> + </DockPanel> + <Canvas> + <Canvas.Style> + <Style TargetType="Canvas"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="False" /> + <Condition Binding="{Binding BrushStops[0].IsOutOfGamut,IsAsync=True}" Value="True" /> + </MultiDataTrigger.Conditions> + <Setter Property="Visibility" Value="Visible"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Canvas.Style> + <TextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></TextBlock> + </Canvas> + <DockPanel LastChildFill="False" Margin="0 20 0 0"> + <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Length (m):"></TextBlock> + <touch:TouchNumericTextBox Width="180" DockPanel.Dock="Right" Value="{Binding Length}" StringFormat="0.0" AutoCalculateJogStep="False" HasDecimalPoint="True" Minimum="1" Maximum="100000" KeyboardContainer="{Binding ElementName=Container}" /> + </DockPanel> + </StackPanel> + </DockPanel> + + <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 10 10 0"> + <TextBlock Visibility="{Binding ElementName=toggle_small_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{Binding Length,StringFormat={}{0:N1} m}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Margin" Value="0 16 20 0"></Setter> <Style.Triggers> - <DataTrigger Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="True"> - <Setter Property="Visibility" Value="Collapsed"></Setter> + <DataTrigger Binding="{Binding ElementName=toggleEdit,Path=IsChecked}" Value="True"> + <Setter Property="Margin" Value="0 5 20 0"></Setter> </DataTrigger> </Style.Triggers> </Style> - </DockPanel.Style> - <controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Color code:"></controls:FastTextBlock> - - <Grid DockPanel.Dock="Right" DataContext="{Binding BrushStops[0],IsAsync=True}"> - <StackPanel> - <ContentControl Focusable="False" FocusVisualStyle="{x:Null}" d:DataContext="{d:DesignInstance Type=entities:BrushStop, IsDesignTimeCreatable=False}" Content="{Binding}" Width="180"> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="ContentTemplate"> - <Setter.Value> - <DataTemplate> + </TextBlock.Style> + </TextBlock> - </DataTemplate> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="RGB"> - <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> - </DataTrigger> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="CMYK"> - <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> - </DataTrigger> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="LAB"> - <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> - </DataTrigger> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Twine"> - <Setter Property="ContentTemplate" Value="{StaticResource TWINE_Template}" /> - </DataTrigger> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Volume"> - <Setter Property="ContentTemplate" Value="{StaticResource Volume_Template}" /> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> - </StackPanel> - </Grid> - </DockPanel> - <Canvas> - <Canvas.Style> - <Style TargetType="Canvas"> + <touch:TouchImageButton Command="{Binding ElementName=view,Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding BrushStops[0]}" Width="50" Height="50" Padding="10" Image="{StaticResource Image_Replace_Color}" CornerRadius="30"> + <touch:TouchImageButton.Style> + <Style TargetType="{x:Type touch:TouchImageButton}" BasedOn="{StaticResource {x:Type touch:TouchImageButton}}"> <Setter Property="Visibility" Value="Collapsed"></Setter> <Style.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True" /> <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="False" /> <Condition Binding="{Binding BrushStops[0].IsOutOfGamut,IsAsync=True}" Value="True" /> </MultiDataTrigger.Conditions> @@ -309,97 +349,59 @@ </MultiDataTrigger> </Style.Triggers> </Style> - </Canvas.Style> - <controls:FastTextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></controls:FastTextBlock> - </Canvas> - <DockPanel LastChildFill="False" Margin="0 20 0 0"> - <controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Length (m):"></controls:FastTextBlock> - <touch:TouchNumericTextBox Width="180" DockPanel.Dock="Right" Value="{Binding Length}" StringFormat="0.0" AutoCalculateJogStep="False" HasDecimalPoint="True" Minimum="1" Maximum="100000" KeyboardContainer="{Binding ElementName=Container}" /> - </DockPanel> - </StackPanel> - </DockPanel> - - <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0 10 10 0"> - <controls:FastTextBlock Visibility="{Binding ElementName=toggle_small_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{Binding Length,StringFormat={}{0:N1} m}"> - <controls:FastTextBlock.Style> - <Style TargetType="controls:FastTextBlock"> - <Setter Property="Margin" Value="0 16 20 0"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=toggleEdit,Path=IsChecked}" Value="True"> - <Setter Property="Margin" Value="0 5 20 0"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </controls:FastTextBlock.Style> - </controls:FastTextBlock> + </touch:TouchImageButton.Style> + </touch:TouchImageButton> - <touch:TouchImageButton Command="{Binding ElementName=view,Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding BrushStops[0]}" Width="50" Height="50" Padding="10" Image="{StaticResource Image_Replace_Color}" CornerRadius="30"> - <touch:TouchImageButton.Style> - <Style TargetType="{x:Type touch:TouchImageButton}" BasedOn="{StaticResource {x:Type touch:TouchImageButton}}"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <MultiDataTrigger> - <MultiDataTrigger.Conditions> - <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True" /> - <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="False" /> - <Condition Binding="{Binding BrushStops[0].IsOutOfGamut,IsAsync=True}" Value="True" /> - </MultiDataTrigger.Conditions> - <Setter Property="Visibility" Value="Visible"></Setter> - </MultiDataTrigger> - </Style.Triggers> - </Style> - </touch:TouchImageButton.Style> - </touch:TouchImageButton> + <StackPanel Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}" Orientation="Horizontal"> - <StackPanel Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}" Orientation="Horizontal"> + <touch:TouchIconButton Command="{Binding ElementName=view,Path=DataContext.RemoveSegmentCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> - <touch:TouchIconButton Command="{Binding ElementName=view,Path=DataContext.RemoveSegmentCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> - - <dragAndDrop:DragThumb Background="Transparent" IsHitTestVisible="True"> - <touch:TouchIconButton IsHitTestVisible="False" EnableDropShadow="False" Icon="BarsSolid" Padding="15" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> - </dragAndDrop:DragThumb> + <dragAndDrop:DragThumb Background="Transparent" IsHitTestVisible="True"> + <touch:TouchIconButton IsHitTestVisible="False" EnableDropShadow="False" Icon="BarsSolid" Padding="15" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> + </dragAndDrop:DragThumb> + </StackPanel> </StackPanel> - </StackPanel> - </Grid> - </DockPanel> - </Grid> + </Grid> + </DockPanel> + </Grid> - <Border Grid.Row="1" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0 1 0 0"> - <Border.Style> - <Style TargetType="Border"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <MultiDataTrigger> - <MultiDataTrigger.Conditions> - <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="True"></Condition> - <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True"></Condition> - </MultiDataTrigger.Conditions> + <Border Grid.Row="1" BorderBrush="{StaticResource TangoGrayBrush}" BorderThickness="0 1 0 0"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="True"></Condition> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True"></Condition> + </MultiDataTrigger.Conditions> - <Setter Property="Visibility" Value="Visible"></Setter> - </MultiDataTrigger> - </Style.Triggers> - </Style> - </Border.Style> + <Setter Property="Visibility" Value="Visible"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Border.Style> - <StackPanel> - <ItemsControl ItemsSource="{Binding BrushStops}" ItemTemplate="{StaticResource BrushStop_Template}"> + <StackPanel> + <ItemsControl ItemsSource="{Binding BrushStops}" ItemTemplate="{StaticResource BrushStop_Template}"> - </ItemsControl> + </ItemsControl> - <touch:TouchButton Command="{Binding ElementName=view,Path=DataContext.AddBrushStopCommand}" CommandParameter="{Binding}" Background="Transparent" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontWeight="Normal" Foreground="{StaticResource TangoPrimaryAccentBrush}" HorizontalAlignment="Left" EnableDropShadow="False" Margin="50 30 0 60"> - <StackPanel Orientation="Horizontal"> - <Grid Width="49" Height="49"> - <Rectangle Stroke="{StaticResource TangoPrimaryAccentBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="5" RadiusY="5"></Rectangle> - <fa:ImageAwesome Icon="Plus" Width="16" Height="16" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> - </Grid> + <touch:TouchButton Command="{Binding ElementName=view,Path=DataContext.AddBrushStopCommand}" CommandParameter="{Binding}" Background="Transparent" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontWeight="Normal" Foreground="{StaticResource TangoPrimaryAccentBrush}" HorizontalAlignment="Left" EnableDropShadow="False" Margin="50 30 0 60"> + <StackPanel Orientation="Horizontal"> + <Grid Width="49" Height="49"> + <Rectangle Stroke="{StaticResource TangoPrimaryAccentBrush}" StrokeThickness="1" StrokeDashArray="5 5 5 5" RadiusX="5" RadiusY="5"></Rectangle> + <fa:ImageAwesome Icon="Plus" Width="16" Height="16" Foreground="{StaticResource TangoPrimaryAccentBrush}" /> + </Grid> - <controls:FastTextBlock VerticalAlignment="Center" Margin="20 0 0 0">ADD COLOR</controls:FastTextBlock> - </StackPanel> - </touch:TouchButton> - </StackPanel> - </Border> - </Grid> - </Border> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">ADD COLOR</TextBlock> + </StackPanel> + </touch:TouchButton> + </StackPanel> + </Border> + </Grid> + </Border> + </touch:TouchVirtualizedContentControl> </DataTemplate> </UserControl.Resources> @@ -425,67 +427,69 @@ <touch:LightTouchScrollViewer x:Name="scrollViewer" Scrolling="scrollViewer_Scrolling"> <StackPanel Margin="10 60 10 0"> <StackPanel> - <touch:TouchExpander Padding="20 15" IsExpanded="{Binding IsJobDetailsExpanded}"> - <touch:TouchExpander.Header> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> - <Image Source="../Images/JobView/job-details.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Details</TextBlock> + <touch:TouchVirtualizedContentControl> + <touch:TouchExpander Padding="20 15" IsExpanded="{Binding IsJobDetailsExpanded}"> + <touch:TouchExpander.Header> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> + <Image Source="../Images/JobView/job-details.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Details</TextBlock> - <TextBlock FontWeight="Medium" Margin="50 0 0 0" VerticalAlignment="Center"> + <TextBlock FontWeight="Medium" Margin="50 0 0 0" VerticalAlignment="Center"> <Run Text="{Binding Job.Rml.Name}"></Run><Run>,</Run> <Run Text="{Binding Job.ColorSpace.Name}"></Run> - </TextBlock> - </StackPanel> - </touch:TouchExpander.Header> + </TextBlock> + </StackPanel> + </touch:TouchExpander.Header> - <StackPanel Margin="60 30 60 20" TextElement.FontWeight="Medium"> - <controls:TableGrid RowHeight="50"> + <StackPanel Margin="60 30 60 20" TextElement.FontWeight="Medium"> + <controls:TableGrid RowHeight="50"> - <TextBlock>Job name:</TextBlock> - <touch:TouchTextBox Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" FocusSelectionMode="SelectAll" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> + <TextBlock>Job name:</TextBlock> + <touch:TouchTextBox Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" FocusSelectionMode="SelectAll" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> - <TextBlock>Customer:</TextBlock> - <touch:TouchAutoComplete ForceItemSelection="False" Text="{Binding CustomersFilter}" ItemsSource="{Binding Customers}" SelectedItem="{Binding Job.Customer}" DisplayMemberPath="Name" AutoCompleteProvider="{Binding CustomersAutoCompleteProvider}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> + <TextBlock>Customer:</TextBlock> + <touch:TouchAutoComplete ForceItemSelection="False" Text="{Binding CustomersFilter}" ItemsSource="{Binding Customers}" SelectedItem="{Binding Job.Customer}" DisplayMemberPath="Name" AutoCompleteProvider="{Binding CustomersAutoCompleteProvider}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> - <TextBlock>Thread type:</TextBlock> - <touch:TouchComboBox ItemsSource="{Binding Rmls}" SelectedItem="{Binding Job.Rml}" DisplayMemberPath="Name" Title="Select Thread" /> + <TextBlock>Thread type:</TextBlock> + <touch:TouchComboBox ItemsSource="{Binding Rmls}" SelectedItem="{Binding Job.Rml}" DisplayMemberPath="Name" Title="Select Thread" /> - <TextBlock>Comment:</TextBlock> - <TextBox Margin="20 0 0 -42" Text="{Binding Job.Description}" FocusVisualStyle="{x:Null}" BorderBrush="{StaticResource TangoDividerBrush}" Foreground="{StaticResource TangoDarkForegroundBrush}" AcceptsReturn="True" TextWrapping="Wrap" Height="60" Padding="5" keyboard:KeyboardView.Container="{Binding ElementName=Container}" keyboard:KeyboardView.Mode="AlphaNumeric"> + <TextBlock>Comment:</TextBlock> + <TextBox Margin="20 0 0 -42" Text="{Binding Job.Description}" FocusVisualStyle="{x:Null}" BorderBrush="{StaticResource TangoDividerBrush}" Foreground="{StaticResource TangoDarkForegroundBrush}" AcceptsReturn="True" TextWrapping="Wrap" Height="60" Padding="5" keyboard:KeyboardView.Container="{Binding ElementName=Container}" keyboard:KeyboardView.Mode="AlphaNumeric"> - </TextBox> - </controls:TableGrid> + </TextBox> + </controls:TableGrid> - <Grid HorizontalAlignment="Center" Margin="0 20 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - <ColumnDefinition Width="Auto" /> - </Grid.ColumnDefinitions> + <Grid HorizontalAlignment="Center" Margin="0 20 0 0" TextElement.Foreground="{StaticResource TangoGrayTextBrush}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> - <TextBlock HorizontalAlignment="Left"> + <TextBlock HorizontalAlignment="Left"> <Run Text="Job status:"></Run> <Run Text="{Binding Job.JobStatus}"></Run> - </TextBlock> + </TextBlock> - <Rectangle Margin="20 0" Grid.Column="1" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" /> + <Rectangle Margin="20 0" Grid.Column="1" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" /> - <TextBlock Grid.Column="2" HorizontalAlignment="Center"> + <TextBlock Grid.Column="2" HorizontalAlignment="Center"> <Run Text="Last updated:"></Run> <Run Text="{Binding Job.LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=Never}"></Run> - </TextBlock> + </TextBlock> - <Rectangle Margin="20 0" Grid.Column="3" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" /> + <Rectangle Margin="20 0" Grid.Column="3" HorizontalAlignment="Center" StrokeThickness="1" Stroke="{StaticResource TangoGrayTextBrush}" /> - <TextBlock Grid.Column="4" HorizontalAlignment="Right"> + <TextBlock Grid.Column="4" HorizontalAlignment="Right"> <Run Text="Last dye:"></Run> <Run Text="{Binding Job.LastRun,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=Never}"></Run> - </TextBlock> - </Grid> - </StackPanel> - </touch:TouchExpander> + </TextBlock> + </Grid> + </StackPanel> + </touch:TouchExpander> + </touch:TouchVirtualizedContentControl> <Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> <Grid> @@ -612,75 +616,79 @@ </Grid> </Border> - <Border Style="{StaticResource TangoTouchBorder}" Margin="0 20 0 0" Padding="0 0 0 50" Visibility="{Binding Job.EmbroideryFileData,Converter={StaticResource IsNullToVisibilityConverter}}"> - <StackPanel> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> - <Image Source="../Images/embroidery.png" RenderOptions.BitmapScalingMode="Fant" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Embroidery File</TextBlock> - </StackPanel> + <touch:TouchVirtualizedContentControl Margin="0 20 0 0"> + <Border Style="{StaticResource TangoTouchBorder}" Padding="0 0 0 50" Visibility="{Binding Job.EmbroideryFileData,Converter={StaticResource IsNullToVisibilityConverter}}"> + <StackPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <Image Source="../Images/embroidery.png" RenderOptions.BitmapScalingMode="Fant" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Embroidery File</TextBlock> + </StackPanel> - <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> - <DockPanel> - <Image Source="{Binding Job,Converter={StaticResource JobToEmbroideryImageConverter}}" Width="230" Stretch="Uniform" HorizontalAlignment="Left"></Image> + <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> + <DockPanel> + <Image Source="{Binding Job,Converter={StaticResource JobToEmbroideryImageConverter}}" Width="230" Stretch="Uniform" HorizontalAlignment="Left"></Image> - <StackPanel VerticalAlignment="Center" HorizontalAlignment="Right"> - <TextBlock TextWrapping="Wrap" TextAlignment="Right">Export the attached embroidery file to storage.</TextBlock> - <touch:TouchButton Command="{Binding ExportEmbroideryCommand}" Style="{StaticResource TangoHollowButton}" Width="240" Height="60" Margin="0 30 0 0" HorizontalAlignment="Right">EXPORT FILE</touch:TouchButton> - </StackPanel> - </DockPanel> + <StackPanel VerticalAlignment="Center" HorizontalAlignment="Right"> + <TextBlock TextWrapping="Wrap" TextAlignment="Right">Export the attached embroidery file to storage.</TextBlock> + <touch:TouchButton Command="{Binding ExportEmbroideryCommand}" Style="{StaticResource TangoHollowButton}" Width="240" Height="60" Margin="0 30 0 0" HorizontalAlignment="Right">EXPORT FILE</touch:TouchButton> + </StackPanel> + </DockPanel> + </StackPanel> </StackPanel> - </StackPanel> - </Border> + </Border> + </touch:TouchVirtualizedContentControl> - <Border Style="{StaticResource TangoTouchBorder}" Margin="0 20 0 0" Padding="0 0 0 50"> - <StackPanel> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> - <Image Source="../Images/JobView/job-summary.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Summary</TextBlock> - </StackPanel> + <touch:TouchVirtualizedContentControl Margin="0 20 0 0" > + <Border Style="{StaticResource TangoTouchBorder}" Padding="0 0 0 50"> + <StackPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <Image Source="../Images/JobView/job-summary.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Job Summary</TextBlock> + </StackPanel> - <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> - <Grid> - <localControls:JobSummeryViewer DataContext="{Binding Job,IsAsync=True}" /> - </Grid> + <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> + <Grid> + <localControls:JobSummeryViewer DataContext="{Binding Job,IsAsync=True}" /> + </Grid> - <DockPanel Margin="0 30 0 0" LastChildFill="False"> + <DockPanel Margin="0 30 0 0" LastChildFill="False"> - <StackPanel Orientation="Horizontal" DockPanel.Dock="Left" VerticalAlignment="Center"> - <TextBlock> + <StackPanel Orientation="Horizontal" DockPanel.Dock="Left" VerticalAlignment="Center"> + <TextBlock> <Run Text="Job length (m):"></Run> <Run Text="{Binding Job.Length,Mode=OneWay}"></Run> - </TextBlock> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}"> - <TextBlock.Style> - <Style TargetType="TextBlock"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.LengthPercentageFactor,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=0}" Value="True"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </TextBlock.Style> + </TextBlock> + <TextBlock Foreground="{StaticResource TangoGrayTextBrush}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.LengthPercentageFactor,Converter={StaticResource GreaterThanToBooleanConverter},ConverterParameter=0}" Value="True"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> <Run>(</Run><Run Text="{Binding Job.Length,Mode=OneWay}"></Run><Run>+</Run><Run Text="{Binding Job.LengthPercentageFactor,Mode=OneWay}"></Run><Run>%</Run><Run>)</Run> - </TextBlock> - </StackPanel> + </TextBlock> + </StackPanel> - <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 -20 5 0"> - <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}" VerticalAlignment="Bottom"> + <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 -20 5 0"> + <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}" VerticalAlignment="Bottom"> <Run Text="Factor: +"></Run> - </TextBlock> + </TextBlock> - <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Maximum="100" Minimum="0" Value="{Binding Job.LengthPercentageFactor}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> + <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Maximum="100" Minimum="0" Value="{Binding Job.LengthPercentageFactor}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> - <TextBlock VerticalAlignment="Bottom" Foreground="{StaticResource TangoGrayTextBrush}">%</TextBlock> + <TextBlock VerticalAlignment="Bottom" Foreground="{StaticResource TangoGrayTextBrush}">%</TextBlock> - <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" VerticalAlignment="Bottom" /> - </StackPanel> - </DockPanel> + <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" VerticalAlignment="Bottom" /> + </StackPanel> + </DockPanel> + </StackPanel> </StackPanel> - </StackPanel> - </Border> + </Border> + </touch:TouchVirtualizedContentControl> <StackPanel HorizontalAlignment="Center" Margin="20 40 0 40" Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Additional Tools</TextBlock> @@ -708,286 +716,202 @@ </StackPanel> </Border>--> - <touch:TouchExpander x:Name="expander_sample_dye" Margin="0 0 0 0" Padding="20 15"> - <touch:TouchExpander.Header> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> - <Image Source="../Images/JobView/sample-dye.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Sample Dye</TextBlock> - </StackPanel> - </touch:TouchExpander.Header> + <touch:TouchVirtualizedContentControl> + <touch:TouchExpander x:Name="expander_sample_dye" Margin="0 0 0 0" Padding="20 15"> + <touch:TouchExpander.Header> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> + <Image Source="../Images/JobView/sample-dye.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Sample Dye</TextBlock> + </StackPanel> + </touch:TouchExpander.Header> - <StackPanel> - <StackPanel Margin="60 20 0 0"> - <ContentControl> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel> - <ContentControl Content="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext}"> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="ContentTemplate"> - <Setter.Value> - <DataTemplate> - <StackPanel> - <TextBlock> + <StackPanel> + <StackPanel Margin="60 20 0 0"> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <ContentControl Content="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext}"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <StackPanel> + <TextBlock> <Run>Dye 1 or more units in order to get approval.</Run> <LineBreak/> <Run>Once approved, you can dye the entire job.</Run> - </TextBlock> + </TextBlock> - <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left"> - <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">How many sample units?</TextBlock> + <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">How many sample units?</TextBlock> - <DockPanel Margin="50 0 0 0"> - <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> - <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> - <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" /> + <DockPanel Margin="50 0 0 0"> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" /> + </DockPanel> </DockPanel> - </DockPanel> - </StackPanel> - </DataTemplate> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Sewing}"> - <Setter Property="ContentTemplate"> - <Setter.Value> - <DataTemplate> - <StackPanel> - <TextBlock> + </StackPanel> + </DataTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Sewing}"> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <StackPanel> + <TextBlock> <Run>Dye several meters per segment in order to get approval.</Run> <LineBreak/> <Run>Once approved, you can dye the entire job.</Run> - </TextBlock> + </TextBlock> - <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left"> - <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">Meters per segment</TextBlock> + <DockPanel Margin="0 50 0 0" LastChildFill="True" Width="450" HorizontalAlignment="Left"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center">Meters per segment</TextBlock> - <DockPanel Margin="50 0 0 0"> - <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> - <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> - <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" /> + <DockPanel Margin="50 0 0 0"> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="-" DockPanel.Dock="Left" Icon="Minus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchIconButton Command="{Binding IncreaseDecreaseSamplesToDyeCommand}" CommandParameter="+" DockPanel.Dock="Right" Icon="Plus" Padding="15" Style="{StaticResource TangoHollowButton}" BorderThickness="2" Width="51" Height="51" /> + <touch:TouchNumericTextBox Value="{Binding Job.SampleUnitsOrMeters}" Minimum="1" Maximum="100" HorizontalContentAlignment="Center" VerticalAlignment="Center" Margin="10 0" Foreground="{StaticResource TangoPrimaryAccentBrush}" FontSize="{StaticResource TangoTitleFontSize}" DockPanel.Dock="Right" KeyboardContainer="{Binding ElementName=Container}" /> + </DockPanel> </DockPanel> - </DockPanel> - </StackPanel> - </DataTemplate> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> + </StackPanel> + </DataTemplate> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> - <touch:TouchButton Margin="0 50 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartSampleDyeCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}"> - START - </touch:TouchButton> - </StackPanel> - </Setter.Value> - </Setter> + <touch:TouchButton Margin="0 50 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartSampleDyeCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}"> + START + </touch:TouchButton> + </StackPanel> + </Setter.Value> + </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel> - <TextBlock>How to continue?</TextBlock> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <TextBlock>How to continue?</TextBlock> - <UniformGrid Columns="2" Width="420" HorizontalAlignment="Left" Margin="0 40 0 20"> - <StackPanel HorizontalAlignment="Left"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveSampleCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Check"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">DONE</TextBlock> - </StackPanel> - </touch:TouchButton> + <UniformGrid Columns="2" Width="420" HorizontalAlignment="Left" Margin="0 40 0 20"> + <StackPanel HorizontalAlignment="Left"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveSampleCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Check"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">DONE</TextBlock> + </StackPanel> + </touch:TouchButton> - <TextBlock Margin="0 15 0 0" TextAlignment="Center">The sample is approved</TextBlock> - </StackPanel> + <TextBlock Margin="0 15 0 0" TextAlignment="Center">The sample is approved</TextBlock> + </StackPanel> - <StackPanel HorizontalAlignment="Right"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatSampleDyeCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Repeat"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">REPEAT</TextBlock> - </StackPanel> - </touch:TouchButton> + <StackPanel HorizontalAlignment="Right"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatSampleDyeCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Repeat"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">REPEAT</TextBlock> + </StackPanel> + </touch:TouchButton> - <TextBlock Margin="0 15 0 0" TextAlignment="Center">Dye more samples</TextBlock> - </StackPanel> - </UniformGrid> + <TextBlock Margin="0 15 0 0" TextAlignment="Center">Dye more samples</TextBlock> + </StackPanel> + </UniformGrid> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> - <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.Approved}"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel Margin="0 40 80 40"> - <DockPanel LastChildFill="False"> - <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> + <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.Approved}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Margin="0 40 80 40"> + <DockPanel LastChildFill="False"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> <Run>Sample Approved:</Run> <Run Text="{Binding Job.SampleDyeApproveDate,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=''}"></Run> - </TextBlock> - <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding AnotherSampleCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Plus"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">ANOTHER SAMPLE</TextBlock> - </StackPanel> - </touch:TouchButton> - </DockPanel> - </StackPanel> - </Setter.Value> - </Setter> + </TextBlock> + <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding AnotherSampleCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Plus"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">ANOTHER SAMPLE</TextBlock> + </StackPanel> + </touch:TouchButton> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </StackPanel> + + <StackPanel Margin="0 0 0 15"> + <StackPanel.Style> + <Style TargetType="StackPanel"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}"> + <Setter Property="Visibility" Value="Visible"></Setter> </DataTrigger> </Style.Triggers> </Style> - </ContentControl.Style> - </ContentControl> - </StackPanel> - - <StackPanel Margin="0 0 0 15"> - <StackPanel.Style> - <Style TargetType="StackPanel"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobSampleDyeStatus}" Value="{x:Static enumerations:SampleDyeStatuses.PendingApproval}"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </StackPanel.Style> - <Rectangle HorizontalAlignment="Stretch" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" Margin="-20 30"></Rectangle> + </StackPanel.Style> + <Rectangle HorizontalAlignment="Stretch" StrokeThickness="1" Stroke="{StaticResource TangoDividerBrush}" Margin="-20 30"></Rectangle> - <StackPanel Orientation="Horizontal" Margin="60 0 0 0"> - <touch:TouchIcon Icon="AlertCircleOutline" Width="32" Height="32" StrokeThickness="0.1" Foreground="{StaticResource TangoGrayBrush}" /> - <TextBlock Margin="10 0 0 0" VerticalAlignment="Center"> + <StackPanel Orientation="Horizontal" Margin="60 0 0 0"> + <touch:TouchIcon Icon="AlertCircleOutline" Width="32" Height="32" StrokeThickness="0.1" Foreground="{StaticResource TangoGrayBrush}" /> + <TextBlock Margin="10 0 0 0" VerticalAlignment="Center"> You can use the color fine tuning tool to adjust the colors. - </TextBlock> + </TextBlock> + </StackPanel> </StackPanel> </StackPanel> - </StackPanel> - </touch:TouchExpander> - - <touch:TouchExpander x:Name="expander_fine_tuning" Margin="0 20 0 120" Padding="20 15" IsExpanded="{Binding IsFineTuneExpanded,Mode=TwoWay}" Visibility="{Binding Job.ColorSpace,Converter={StaticResource ColorSpaceToVisibilityConverter}}"> - <touch:TouchExpander.Header> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> - <Image Source="../Images/JobView/color-fine-tuning.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color Fine Tuning</TextBlock> - </StackPanel> - </touch:TouchExpander.Header> - - <StackPanel Margin="60 20 0 0"> - - <ContentControl> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel> - <TextBlock>Select the colors you want to fine tune.</TextBlock> + </touch:TouchExpander> + </touch:TouchVirtualizedContentControl> - <StackPanel HorizontalAlignment="Center" Margin="0 40 0 0"> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Defined Colors</TextBlock> + <touch:TouchVirtualizedContentControl> + <touch:TouchExpander x:Name="expander_fine_tuning" Margin="0 20 0 120" Padding="20 15" IsExpanded="{Binding IsFineTuneExpanded,Mode=TwoWay}" Visibility="{Binding Job.ColorSpace,Converter={StaticResource ColorSpaceToVisibilityConverter}}"> + <touch:TouchExpander.Header> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="0 0 20 0"> + <Image Source="../Images/JobView/color-fine-tuning.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color Fine Tuning</TextBlock> + </StackPanel> + </touch:TouchExpander.Header> - <ItemsControl Margin="0 40 0 0" ItemsSource="{Binding FineTuneItems}"> - <ItemsControl.ItemTemplate> - <DataTemplate> - <DockPanel> - <touch:TouchCheckBox DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" Margin="0 0 20 0" /> - <touch:TouchImageButton DockPanel.Dock="Right" Image="{StaticResource Image_Color_Picker}" Width="80" Height="80" Padding="15" CornerRadius="100" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.InvokeFineTuningPaletteCommand}" CommandParameter="{Binding}"></touch:TouchImageButton> - <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}" IsEnabled="False"> - <touch:TouchFlatListBox.ItemsPanel> - <ItemsPanelTemplate> - <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid> - </ItemsPanelTemplate> - </touch:TouchFlatListBox.ItemsPanel> - <touch:TouchFlatListBox.ItemTemplate> - <DataTemplate> - <Ellipse Width="70" Height="70" Fill="{Binding Brush}" Margin="30 0"> - <Ellipse.Style> - <Style TargetType="Ellipse"> - <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> - <Setter Property="RenderTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="1" /> - </Setter.Value> - </Setter> - <Setter Property="Effect"> - <Setter.Value> - <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="10" Direction="10" BlurRadius="15" Opacity="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Ellipse.Style> - </Ellipse> - </DataTemplate> - </touch:TouchFlatListBox.ItemTemplate> - </touch:TouchFlatListBox> - </DockPanel> - </DataTemplate> - </ItemsControl.ItemTemplate> - </ItemsControl> - </StackPanel> + <StackPanel Margin="60 20 0 0"> - <DockPanel LastChildFill="False" Margin="0 80 0 0"> - <touch:TouchButton Command="{Binding ResetFineTuningCommand}" DockPanel.Dock="Left" Padding="40 10" Margin="-30 0 0 0" Style="{StaticResource TangoFlatButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}">Reset</touch:TouchButton> + <ContentControl> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel> + <TextBlock>Select the colors you want to fine tune.</TextBlock> - <touch:TouchButton Margin="0 0 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartFineTuningCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}"> - START - </touch:TouchButton> - </DockPanel> - </StackPanel> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.PendingApproval}"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel Margin="0 20 0 0"> - <StackPanel Orientation="Horizontal"> - <Grid> - <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> - <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">1</TextBlock> - </Grid> - <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">Select the best variation for each color:</TextBlock> - </StackPanel> + <StackPanel HorizontalAlignment="Center" Margin="0 40 0 0"> + <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Defined Colors</TextBlock> - <ItemsControl Margin="65 40 120 0" ItemsSource="{Binding ApprovalFineTuneItems}" AlternationCount="1000"> + <ItemsControl Margin="0 40 0 0" ItemsSource="{Binding FineTuneItems}"> <ItemsControl.ItemTemplate> <DataTemplate> <DockPanel> - <TextBlock Margin="0 0 20 0" VerticalAlignment="Center"> - <Run>Color</Run> - <Run>#</Run><Run Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(ItemsControl.AlternationIndex),Mode=OneWay,Converter={StaticResource MathOperatorConverter},ConverterParameter='+1'}"></Run> - </TextBlock> - <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}"> + <touch:TouchCheckBox DockPanel.Dock="Left" IsChecked="{Binding IsSelected}" Margin="0 0 20 0" /> + <touch:TouchImageButton DockPanel.Dock="Right" Image="{StaticResource Image_Color_Picker}" Width="80" Height="80" Padding="15" CornerRadius="100" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.InvokeFineTuningPaletteCommand}" CommandParameter="{Binding}"></touch:TouchImageButton> + <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}" IsEnabled="False"> <touch:TouchFlatListBox.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid> @@ -1041,69 +965,157 @@ </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> + </StackPanel> - <StackPanel Orientation="Horizontal" Margin="0 40 0 0"> - <Grid> - <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> - <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">2</TextBlock> - </Grid> - <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">How to continue</TextBlock> - </StackPanel> + <DockPanel LastChildFill="False" Margin="0 80 0 0"> + <touch:TouchButton Command="{Binding ResetFineTuningCommand}" DockPanel.Dock="Left" Padding="40 10" Margin="-30 0 0 0" Style="{StaticResource TangoFlatButton}" Foreground="{StaticResource TangoPrimaryAccentBrush}">Reset</touch:TouchButton> - <UniformGrid Columns="2" Width="530" HorizontalAlignment="Left" Margin="0 40 0 20"> - <StackPanel HorizontalAlignment="Left"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveFineTuningCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Check"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">DONE</TextBlock> - </StackPanel> - </touch:TouchButton> - - <TextBlock Margin="0 15 0 0" TextAlignment="Center">All colors are approved</TextBlock> + <touch:TouchButton Margin="0 0 0 15" DockPanel.Dock="Right" Height="54" Padding="0" Width="184" CornerRadius="30" BlurRadius="20" HorizontalAlignment="Right" Command="{Binding StartFineTuningCommand}" IsEnabled="{Binding MachineProvider.MachineOperator.CanPrint}"> + START + </touch:TouchButton> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.PendingApproval}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Margin="0 20 0 0"> + <StackPanel Orientation="Horizontal"> + <Grid> + <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">1</TextBlock> + </Grid> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">Select the best variation for each color:</TextBlock> </StackPanel> - <StackPanel HorizontalAlignment="Right"> - <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatFineTuningCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Repeat"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">REPEAT</TextBlock> - </StackPanel> - </touch:TouchButton> + <ItemsControl Margin="65 40 120 0" ItemsSource="{Binding ApprovalFineTuneItems}" AlternationCount="1000"> + <ItemsControl.ItemTemplate> + <DataTemplate> + <DockPanel> + <TextBlock Margin="0 0 20 0" VerticalAlignment="Center"> + <Run>Color</Run> + <Run>#</Run><Run Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(ItemsControl.AlternationIndex),Mode=OneWay,Converter={StaticResource MathOperatorConverter},ConverterParameter='+1'}"></Run> + </TextBlock> + <touch:TouchFlatListBox ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}"> + <touch:TouchFlatListBox.ItemsPanel> + <ItemsPanelTemplate> + <UniformGrid Columns="{Binding Suggestions.Count}" Margin="0 20"></UniformGrid> + </ItemsPanelTemplate> + </touch:TouchFlatListBox.ItemsPanel> + <touch:TouchFlatListBox.ItemTemplate> + <DataTemplate> + <Ellipse Width="70" Height="70" Fill="{Binding Brush}" Margin="30 0"> + <Ellipse.Style> + <Style TargetType="Ellipse"> + <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> + <Setter Property="Effect"> + <Setter.Value> + <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="10" Direction="10" BlurRadius="15" Opacity="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Ellipse.Style> + </Ellipse> + </DataTemplate> + </touch:TouchFlatListBox.ItemTemplate> + </touch:TouchFlatListBox> + </DockPanel> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> - <TextBlock Margin="0 15 0 0" TextAlignment="Left" TextWrapping="Wrap" Width="170">Some color need more fine tuning</TextBlock> + <StackPanel Orientation="Horizontal" Margin="0 40 0 0"> + <Grid> + <Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" StrokeThickness="2" Width="42" Height="42"></Ellipse> + <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="Bold">2</TextBlock> + </Grid> + <TextBlock Margin="20 0 0 0" VerticalAlignment="Center">How to continue</TextBlock> </StackPanel> - </UniformGrid> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> - <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.Approved}"> - <Setter Property="Content"> - <Setter.Value> - <StackPanel Margin="0 40 80 40"> - <DockPanel LastChildFill="False"> - <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> + <UniformGrid Columns="2" Width="530" HorizontalAlignment="Left" Margin="0 40 0 20"> + <StackPanel HorizontalAlignment="Left"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding ApproveFineTuningCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Check"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">DONE</TextBlock> + </StackPanel> + </touch:TouchButton> + + <TextBlock Margin="0 15 0 0" TextAlignment="Center">All colors are approved</TextBlock> + </StackPanel> + + <StackPanel HorizontalAlignment="Right"> + <touch:TouchButton Style="{StaticResource TangoHollowButton}" Width="180" Height="50" Command="{Binding RepeatFineTuningCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Repeat"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">REPEAT</TextBlock> + </StackPanel> + </touch:TouchButton> + + <TextBlock Margin="0 15 0 0" TextAlignment="Left" TextWrapping="Wrap" Width="170">Some color need more fine tuning</TextBlock> + </StackPanel> + </UniformGrid> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + + <DataTrigger Binding="{Binding Job.JobFineTuningStatus}" Value="{x:Static enumerations:FineTuningStatuses.Approved}"> + <Setter Property="Content"> + <Setter.Value> + <StackPanel Margin="0 40 80 40"> + <DockPanel LastChildFill="False"> + <TextBlock DockPanel.Dock="Left" VerticalAlignment="Center"> <Run>Colors Approved:</Run> <Run Text="{Binding Job.FineTuningApproveDate,Converter={StaticResource DateTimeUTCToShortDateConverter},TargetNullValue=''}"></Run> - </TextBlock> - <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding RepeatFineTuningCommand}"> - <StackPanel Orientation="Horizontal"> - <touch:TouchIcon Icon="Plus"></touch:TouchIcon> - <TextBlock Margin="10 0 0 0">REPEAT FINE TUNING</TextBlock> - </StackPanel> - </touch:TouchButton> - </DockPanel> - </StackPanel> - </Setter.Value> - </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> - </StackPanel> - </touch:TouchExpander> + </TextBlock> + <touch:TouchButton DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource TangoHollowButton}" Width="220" Height="50" Command="{Binding RepeatFineTuningCommand}"> + <StackPanel Orientation="Horizontal"> + <touch:TouchIcon Icon="Plus"></touch:TouchIcon> + <TextBlock Margin="10 0 0 0">REPEAT FINE TUNING</TextBlock> + </StackPanel> + </touch:TouchButton> + </DockPanel> + </StackPanel> + </Setter.Value> + </Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </StackPanel> + </touch:TouchExpander> + </touch:TouchVirtualizedContentControl> </StackPanel> </StackPanel> </touch:LightTouchScrollViewer> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml index 475437cf3..5b9c234f0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml @@ -2,6 +2,7 @@ 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:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.PPC.Jobs.Views" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" @@ -32,6 +33,7 @@ <sharedConverters:EnumToDescriptionConverter x:Key="EnumToDescriptionConverter" /> <sharedConverters:EnumToItemsSourceConverter x:Key="EnumToItemsSourceConverter" /> <converters:JobsCategoryToVisibilityConverter x:Key="JobsCategoryToVisibilityConverter" /> + <converters:JobsCategoryToOpacityConverter x:Key="JobsCategoryToOpacityConverter" /> </ResourceDictionary> </UserControl.Resources> @@ -172,7 +174,7 @@ <Grid Grid.Row="1" x:Name="moveGrid"> <touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='Draft'}"> - <touch:LightTouchDataGrid AnimateSorting="False" RenderOptions.EdgeMode="Unspecified" Style="{StaticResource TangoJobsGrid}" x:Name="dataGridJobs" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" OnDragAndDropCommand="{Binding JobDragedDroppedCommand}" ItemsSource="{Binding DraftJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10"> + <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" RenderOptions.EdgeMode="Unspecified" Style="{StaticResource TangoJobsGrid}" x:Name="dataGridJobs" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" OnDragAndDropCommand="{Binding JobDragedDroppedCommand}" ItemsSource="{Binding DraftJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10"> <touch:LightTouchDataGrid.Columns> <touch:LightTouchDataGridColumn Width="90"> <touch:LightTouchDataGridColumn.Header> @@ -212,28 +214,28 @@ <touch:LightTouchDataGridColumn Width="1*" Header="Name" SortMember="Name" HorizontalContentAlignment="Left"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding Name}"></TextBlock> + <controls:FastTextBlock IsHitTestVisible="False" Text="{Binding Name,IsAsync=True}"></controls:FastTextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> <touch:LightTouchDataGridColumn Width="117" Header="Length (m)" SortMember="Length"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding Length,StringFormat=0.0}"></TextBlock> + <controls:FastTextBlock IsHitTestVisible="False" Text="{Binding Length,StringFormat=0.0,IsAsync=True}"></controls:FastTextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> <touch:LightTouchDataGridColumn Header="Colors" SortMember="Segments.Count" Width="85"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <Image Stretch="Fill" IsHitTestVisible="False" Source="{Binding Converter={StaticResource JobToPieImageConverter},ConverterParameter='25,25'}" Width="25" Height="25" HorizontalAlignment="Left"></Image> + <Image Stretch="Fill" IsHitTestVisible="False" Source="{Binding Converter={StaticResource JobToPieImageConverter},ConverterParameter='25,25',IsAsync=True}" Width="25" Height="25" HorizontalAlignment="Left"></Image> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> <touch:LightTouchDataGridColumn Width="100" Header="Updated" SortMember="LastUpdated"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter}}"></TextBlock> + <controls:FastTextBlock IsHitTestVisible="False" Text="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter},IsAsync=True}"></controls:FastTextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> @@ -284,7 +286,7 @@ </touch:TouchLoadingPanel> <touch:TouchLoadingPanel IsLoading="{Binding IsLoadingJobs}" Visibility="{Binding SelectedCategory,Converter={StaticResource JobsCategoryToVisibilityConverter},ConverterParameter='History'}"> - <touch:LightTouchDataGrid AnimateSorting="False" EnableDragAndDrop="False" RenderOptions.EdgeMode="Unspecified" x:Name="dataGridJobsHistory" Style="{StaticResource TangoJobsGrid}" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" ItemsSource="{Binding HistoryJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10"> + <touch:LightTouchDataGrid CollectionFilter="{Binding CollectionFilter}" AnimateSorting="False" EnableDragAndDrop="False" RenderOptions.EdgeMode="Unspecified" x:Name="dataGridJobsHistory" Style="{StaticResource TangoJobsGrid}" SelectedItems="{Binding SelectedJobs}" IsMultiSelecting="{Binding IsMultiSelecting,Mode=TwoWay}" ItemsSource="{Binding HistoryJobsCollectionView}" ItemSelectedCommand="{Binding JobSelectedCommand}" Margin="10"> <touch:LightTouchDataGrid.Columns> <touch:LightTouchDataGridColumn Width="50"> <touch:LightTouchDataGridColumn.Header> @@ -312,35 +314,35 @@ <touch:LightTouchDataGridColumn Width="100" Header="Status" SortMember="JobStatus"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding JobStatus,Converter={StaticResource EnumToDescriptionConverter}}"></TextBlock> + <controls:FastTextBlock IsHitTestVisible="False" Text="{Binding JobStatus,Converter={StaticResource EnumToDescriptionConverter},IsAsync=True}"></controls:FastTextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> <touch:LightTouchDataGridColumn Width="1*" Header="Name" SortMember="Name" HorizontalContentAlignment="Left"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding Name}"></TextBlock> + <controls:FastTextBlock IsHitTestVisible="False" Text="{Binding Name,IsAsync=True}"></controls:FastTextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> <touch:LightTouchDataGridColumn Width="117" Header="Length (m)" SortMember="Length"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding Length,StringFormat=0.0}"></TextBlock> + <controls:FastTextBlock IsHitTestVisible="False" Text="{Binding Length,StringFormat=0.0,IsAsync=True}"></controls:FastTextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> <touch:LightTouchDataGridColumn Header="Colors" SortMember="Segments.Count" Width="85"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <Image Stretch="Fill" IsHitTestVisible="False" Source="{Binding Converter={StaticResource JobToPieImageConverter},ConverterParameter='25,25'}" Width="25" Height="25" HorizontalAlignment="Left"></Image> + <Image Stretch="Fill" IsHitTestVisible="False" Source="{Binding Converter={StaticResource JobToPieImageConverter},ConverterParameter='25,25',IsAsync=True}" Width="25" Height="25" HorizontalAlignment="Left"></Image> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> <touch:LightTouchDataGridColumn Width="100" Header="Updated" SortMember="LastUpdated"> <touch:LightTouchDataGridColumn.CellTemplate> <DataTemplate> - <TextBlock IsHitTestVisible="False" Text="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter}}"></TextBlock> + <controls:FastTextBlock IsHitTestVisible="False" Text="{Binding LastUpdated,Converter={StaticResource DateTimeUTCToShortDateConverter},IsAsync=True}"></controls:FastTextBlock> </DataTemplate> </touch:LightTouchDataGridColumn.CellTemplate> </touch:LightTouchDataGridColumn> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs index d8ef4056c..ceac18e38 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobsView.xaml.cs @@ -12,29 +12,45 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using Tango.Core.DI; +using Tango.PPC.Jobs.ViewContracts; namespace Tango.PPC.Jobs.Views { /// <summary> /// Interaction logic for JobsView.xaml /// </summary> - public partial class JobsView : UserControl + public partial class JobsView : UserControl, IJobsView { public JobsView() { InitializeComponent(); + TangoIOC.Default.Register<IJobsView>(this); } - private async void TouchNavigationLinks_SelectionChanged(object sender, SelectionChangedEventArgs e) + private void TouchNavigationLinks_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (dataGridJobs != null) { - await Task.Delay(200); + //await Task.Delay(200); - dataGridJobs.LayoutRows(false); + //dataGridJobs.LayoutRows(false); + //dataGridJobs.ScrollViewer.ScrollToTop(); + + //dataGridJobsHistory.LayoutRows(false); + //dataGridJobsHistory.ScrollViewer.ScrollToTop(); + } + } + + public void ScrollToTop() + { + if (dataGridJobs != null && dataGridJobs.ScrollViewer != null) + { dataGridJobs.ScrollViewer.ScrollToTop(); + } - dataGridJobsHistory.LayoutRows(false); + if (dataGridJobsHistory != null && dataGridJobsHistory.ScrollViewer != null) + { dataGridJobsHistory.ScrollViewer.ScrollToTop(); } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs index 06cd0661d..23d471138 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Storage/ViewModels/MainViewVM.cs @@ -135,6 +135,7 @@ namespace Tango.PPC.Storage.ViewModels { if (IsVisible) { + _allow_exit = true; await NotificationProvider.ShowError("Storage device disconnected."); await NavigationManager.NavigateBack(); CurrentPath = null; |
