diff options
Diffstat (limited to 'Software/Visual_Studio/PPC')
6 files changed, 611 insertions, 481 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobNavigationObject.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobNavigationObject.cs index 87acfcb17..0f5e39872 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobNavigationObject.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/NavigationObjects/JobNavigationObject.cs @@ -29,6 +29,7 @@ namespace Tango.PPC.Jobs.NavigationObjects public enum JobNavigationIntent { Default, + NewJob, SampleDye, FineTuning, } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index cda2ba96f..874beba75 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -166,6 +166,31 @@ namespace Tango.PPC.Jobs.ViewModels } } + private bool _isJobDetailsExpanded; + /// <summary> + /// Gets or sets a value indicating whether the job details area is expanded. + /// </summary> + public bool IsJobDetailsExpanded + { + get { return _isJobDetailsExpanded; } + set { _isJobDetailsExpanded = value; RaisePropertyChangedAuto(); } + } + + private List<ColorCatalog> _twineCatalogItems; + /// <summary> + /// Gets or sets the twine catalog items. + /// </summary> + public List<ColorCatalog> TwineCatalogItems + { + get { return _twineCatalogItems; } + set { _twineCatalogItems = value; RaisePropertyChangedAuto(); } + } + + /// <summary> + /// Gets or sets the twine catalog automatic complete provider. + /// </summary> + public IAutoCompleteProvider TwineCatalogAutoCompleteProvider { get; set; } + #endregion #region Commands @@ -218,7 +243,7 @@ namespace Tango.PPC.Jobs.ViewModels /// <summary> /// Gets or sets the twine catalog field tap command. /// </summary> - public RelayCommand<BrushStop> TwineCatalogFieldTapCommand { get; set; } + public RelayCommand<BrushStop> OpenTwineCatalogCommand { get; set; } /// <summary> /// Gets or sets the increase decrease samples to dye command. @@ -296,12 +321,19 @@ namespace Tango.PPC.Jobs.ViewModels FineTuneItems = new ObservableCollection<FineTuneItem>(); ApprovalFineTuneItems = new ObservableCollection<FineTuneItem>(); + TwineCatalogItems = new List<ColorCatalog>(); CustomersAutoCompleteProvider = new AutoCompleteProvider<Customer>((customer, filter) => { return customer.Name.ToLower().StartsWith(filter != null ? filter.ToLower() : String.Empty); }); + + TwineCatalogAutoCompleteProvider = new AutoCompleteProvider<ColorCatalog>((color, filter) => + { + return !String.IsNullOrWhiteSpace(filter) && color.Name.ToLower().StartsWith(filter.ToLower()); + }); + //Initialize Commands AddSolidSegmentCommand = new RelayCommand(() => AddSolidSegment()); AddBrushStopCommand = new RelayCommand<Segment>(AddBrushStop); @@ -344,6 +376,7 @@ namespace Tango.PPC.Jobs.ViewModels StartFineTuningCommand = new RelayCommand(StartFineTuning, () => FineTuneItems.Any(x => x.IsSelected)); RepeatFineTuningCommand = new RelayCommand(RepeatFineTuning); ApproveFineTuningCommand = new RelayCommand(ApproveFineTuning); + OpenTwineCatalogCommand = new RelayCommand<BrushStop>(OpenTwineCatalog); } #endregion @@ -367,8 +400,6 @@ namespace Tango.PPC.Jobs.ViewModels _db = ObservablesContext.CreateDefault(); - - Job = await new JobBuilder(_db).Set(_job_to_load.Guid) .WithConfiguration() .WithRML() @@ -387,6 +418,7 @@ namespace Tango.PPC.Jobs.ViewModels SpoolTypes = await _db.SpoolTypes.ToListAsync(); LogManager.Log("Loading Customers..."); Customers = await _db.Customers.Where(x => x.OrganizationGuid == MachineProvider.Machine.OrganizationGuid).ToListAsync(); + TwineCatalogItems = await _db.ColorCatalogs.Where(x => x.ColorSpace.Code == (int)BL.Enumerations.ColorSpaces.Twine).OrderBy(x => x.Name).ToListAsync(); if (!_check_gamut_thread.IsAlive) { @@ -409,6 +441,11 @@ namespace Tango.PPC.Jobs.ViewModels Job.JobFineTuningStatus = BL.Enumerations.FineTuningStatuses.Unspecified; } + if (_job_to_load_intent == JobNavigationIntent.NewJob) + { + IsJobDetailsExpanded = true; + } + LogManager.Log($"Job editing state = '{Job.JobEditingState}'."); if (Job.JobEditingState == BL.Enumerations.EditingStates.SampleDye && Job.JobSampleDyeStatus == BL.Enumerations.SampleDyeStatuses.PendingApproval) @@ -690,6 +727,20 @@ namespace Tango.PPC.Jobs.ViewModels brushStop.OutOfGamutChecked = false; } + /// <summary> + /// Opens the twine catalog for the specified brush stop. + /// </summary> + /// <param name="stop">The stop.</param> + private async void OpenTwineCatalog(BrushStop stop) + { + var catalogItem = await NavigationManager.NavigateForResult<JobsModule, TwineCatalogView, CatalogItem, BrushStop>(stop, true); + + if (catalogItem != null) + { + stop.ColorCatalog = TwineCatalogItems.SingleOrDefault(x => x.Guid == catalogItem.Entity.Guid); + } + } + #endregion #region Job Selection Message @@ -802,7 +853,7 @@ namespace Tango.PPC.Jobs.ViewModels } catch (Exception ex) { - LogManager.Log(ex, "Error while trying to synchronize fine tuning itmes with brush stops."); + LogManager.Log(ex, "Error while trying to synchronize fine tuning items with brush stops."); } } 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 4115462dd..c4bd1f5b8 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 @@ -21,6 +21,7 @@ using Tango.PPC.Jobs.Messages; using Tango.PPC.Jobs.Views; using System.Data.Entity; using Tango.BL.Builders; +using Tango.PPC.Jobs.NavigationObjects; namespace Tango.PPC.Jobs.ViewModels { @@ -322,7 +323,11 @@ namespace Tango.PPC.Jobs.ViewModels RaiseMessage(new JobSelectedMessage() { Job = job, Context = _db }); await Task.Delay(200); - await NavigationManager.NavigateTo<JobsModule>(nameof(JobView)); + await NavigationManager.NavigateWithObject<JobsModule, JobView, JobNavigationObject>(new JobNavigationObject() + { + Job = job, + Intent = JobNavigationIntent.NewJob + }); } catch (Exception ex) { diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/TwineCatalogViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/TwineCatalogViewVM.cs index cd5553b77..6ed4afcd8 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/TwineCatalogViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/TwineCatalogViewVM.cs @@ -73,8 +73,11 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> public override void OnApplicationStarted() { - //Catalog = CatalogLoader.LoadCatalog(BL.Enumerations.ColorSpaces.Twine, ObservablesEntitiesAdapter.Instance.Context); - //Recent = CatalogLoader.GetRecent(Catalog, SettingsManager.Default.GetOrCreate<JobsModuleSettings>().RecentTwineCatalogColors); + InvokeUI(() => + { + Catalog = CatalogLoader.LoadCatalog(BL.Enumerations.ColorSpaces.Twine, ObservablesStaticCollections.Instance.Context); + Recent = CatalogLoader.GetRecent(Catalog, SettingsManager.Default.GetOrCreate<JobsModuleSettings>().RecentTwineCatalogColors); + }); } /// <summary> 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 eaa17f55d..a85da8f18 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 @@ -55,7 +55,23 @@ </DataTemplate> <DataTemplate x:Key="TWINE_Template" DataType="{x:Type entities:BrushStop}"> - <touch:TouchTextBox TapCommand="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TwineCatalogFieldTapCommand}" TapCommandParameter="{Binding}" IsReadOnly="True" keyboard:KeyboardView.Mode="{x:Null}" Margin="2 0" Text="{Binding ColorCatalog.Name}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" /> + <DockPanel> + <touch:TouchIconButton Margin="0 0 -40 0" CornerRadius="50" Width="32" Height="32" Padding="5" RippleBrush="{StaticResource TangoRippleDarkBrush}" DockPanel.Dock="Right" Icon="FormatColorFill" Foreground="{StaticResource TangoPrimaryAccentBrush}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.OpenTwineCatalogCommand}" CommandParameter="{Binding}"></touch:TouchIconButton> + <touch:TouchAutoComplete Margin="2 0" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TwineCatalogItems}" Watermark="Color Code" PopupHeight="250" DisplayMemberPath="Name" AutoCompleteProvider="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.TwineCatalogAutoCompleteProvider}" SelectedItem="{Binding ColorCatalog,Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" keyboard:KeyboardView.Container="{Binding ElementName=Container}"> + <touch:TouchAutoComplete.ItemTemplate> + <DataTemplate> + <DockPanel Margin="2"> + <Rectangle Width="24" Height="24"> + <Rectangle.Fill> + <SolidColorBrush Color="{Binding Color,Mode=OneWay}"></SolidColorBrush> + </Rectangle.Fill> + </Rectangle> + <TextBlock Margin="5 0 0 0" Text="{Binding Name}" VerticalAlignment="Center"></TextBlock> + </DockPanel> + </DataTemplate> + </touch:TouchAutoComplete.ItemTemplate> + </touch:TouchAutoComplete> + </DockPanel> </DataTemplate> <DataTemplate x:Key="BrushStop_Template" DataType="{x:Type entities:BrushStop}"> @@ -347,230 +363,233 @@ <RowDefinition Height="1*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> - <Grid x:Name="Container" keyboard:KeyboardView.ContainerOffset="40" Grid.RowSpan="2"> - <touch:LightTouchScrollViewer x:Name="scrollViewer"> - <StackPanel Margin="10 60 10 0"> - <StackPanel> - <touch:TouchExpander Padding="20 15"> - <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> + <Grid> + <Grid x:Name="Container" keyboard:KeyboardView.ContainerOffset="40" Grid.RowSpan="2"> + <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> - <TextBlock FontWeight="Medium" Margin="50 0 0 0" VerticalAlignment="Center" Text="{Binding Job.Rml.Name}"></TextBlock> - </StackPanel> - </touch:TouchExpander.Header> + <TextBlock FontWeight="Medium" Margin="50 0 0 0" VerticalAlignment="Center" Text="{Binding Job.Rml.Name}"></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" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> + <TextBlock>Job name:</TextBlock> + <touch:TouchTextBox Text="{Binding Job.Name,UpdateSourceTrigger=PropertyChanged,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" KeyboardMode="AlphaNumeric" KeyboardAction="Next" KeyboardContainer="{Binding ElementName=Container}" /> - <TextBlock>Customer:</TextBlock> - <touch:TouchAutoComplete 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 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 Type" /> + <TextBlock>Thread type:</TextBlock> + <touch:TouchComboBox ItemsSource="{Binding Rmls}" SelectedItem="{Binding Job.Rml}" DisplayMemberPath="Name" Title="Select Thread Type" /> - <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"> + <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"> - </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> - - <Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> - <Grid> - <StackPanel> - <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> - <Image Source="../Images/JobView/color-length.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color & Length</TextBlock> - </StackPanel> + </TextBlock> + </Grid> + </StackPanel> + </touch:TouchExpander> + <Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> + <Grid> <StackPanel> - <StackPanel.Style> - <Style TargetType="StackPanel" BasedOn="{StaticResource Level2Container}"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Embroidery}"> - <Setter Property="Visibility" Value="Visible"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </StackPanel.Style> - <UniformGrid Columns="2" Rows="1"> - <DockPanel Margin="0 0 10 0"> - <TextBlock Text="Number of units:" VerticalAlignment="Center"></TextBlock> - <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfUnits}" Minimum="1" Maximum="10000" JoggingFactor="0.01" /> - </DockPanel> + <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <Image Source="../Images/JobView/color-length.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Color & Length</TextBlock> + </StackPanel> - <DockPanel Margin="10 0 0 0"> - <TextBlock Text="Number of heads:" VerticalAlignment="Center"></TextBlock> - <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfHeads}" Minimum="1" Maximum="1000" JoggingFactor="0.1" /> + <StackPanel> + <StackPanel.Style> + <Style TargetType="StackPanel" BasedOn="{StaticResource Level2Container}"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Job.JobType}" Value="{x:Static enumerations:JobTypes.Embroidery}"> + <Setter Property="Visibility" Value="Visible"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </StackPanel.Style> + <UniformGrid Columns="2" Rows="1"> + <DockPanel Margin="0 0 10 0"> + <TextBlock Text="Number of units:" VerticalAlignment="Center"></TextBlock> + <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfUnits}" Minimum="1" Maximum="10000" JoggingFactor="0.01" /> + </DockPanel> + + <DockPanel Margin="10 0 0 0"> + <TextBlock Text="Number of heads:" VerticalAlignment="Center"></TextBlock> + <touch:TouchNumericTextBox Margin="20 0 0 0" Value="{Binding Job.NumberOfHeads}" Minimum="1" Maximum="1000" JoggingFactor="0.1" /> + </DockPanel> + </UniformGrid> + </StackPanel> + + <DockPanel Style="{StaticResource Level2Container}"> + <TextBlock Text="Color Catalog/Space:" VerticalAlignment="Center"></TextBlock> + <touch:TouchComboBox Margin="20 0 0 0" ItemsSource="{Binding ColorSpaces}" SelectedItem="{Binding Job.ColorSpace}" DisplayMemberPath="Name" Title="Select Color Catalog/Space" /> + </DockPanel> + + <Border x:Name="borderDockFloat" Height="80"> + <DockPanel x:Name="dockEdit" LastChildFill="False" Style="{StaticResource Level2ContainerExtraMargin}" Height="40" Width="640"> + <StackPanel DockPanel.Dock="Left" Orientation="Horizontal"> + <touch:TouchToggleIconButton x:Name="toggle_small_list" IsChecked="{Binding ElementName=toggle_large_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ListSolid" CheckedIcon="ListSolid" Padding="8" CornerRadius="20" /> + <Rectangle HorizontalAlignment="Left" Stroke="{StaticResource TangoDividerBrush}" Margin="10 8" /> + <touch:TouchToggleIconButton x:Name="toggle_large_list" IsChecked="{Binding ElementName=toggle_small_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ThListSolid" CheckedIcon="ThListSolid" Padding="8" CornerRadius="20" /> + </StackPanel> + + <touch:TouchToggleIconButton x:Name="toggleEdit" DockPanel.Dock="Right" Icon="Pencil" CheckedIcon="Pencil" Padding="8" CornerRadius="20" /> </DockPanel> - </UniformGrid> - </StackPanel> + </Border> - <DockPanel Style="{StaticResource Level2Container}"> - <TextBlock Text="Color Catalog/Space:" VerticalAlignment="Center"></TextBlock> - <touch:TouchComboBox Margin="20 0 0 0" ItemsSource="{Binding ColorSpaces}" SelectedItem="{Binding Job.ColorSpace}" DisplayMemberPath="Name" Title="Select Color Catalog/Space" /> - </DockPanel> + <ItemsControl x:Name="listSegments" Style="{StaticResource Level2Container}" ItemsSource="{Binding SegmentsCollectionView}" ItemTemplate="{StaticResource Segment_Template}"></ItemsControl> + + <StackPanel HorizontalAlignment="Right" Style="{StaticResource Level2Container}" Orientation="Horizontal"> + <touch:TouchButton Command="{Binding AddSolidSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="170" CornerRadius="20" Padding="0 10" Background="Transparent" BorderThickness="2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}"> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" /> + <TextBlock Margin="10 0 0 0">SOLID SEGMENT</TextBlock> + </StackPanel> + </touch:TouchButton> + <touch:TouchButton Command="{Binding AddGradientSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" Margin="30 0 0 0" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Padding="0 10" Width="200" CornerRadius="20" Background="Transparent" BorderThickness="2"> + <touch:TouchButton.BorderBrush> + <LinearGradientBrush> + <GradientStop Offset="0" Color="{StaticResource TangoPrimaryAccentColor}" /> + <GradientStop Offset="1" Color="#57F157" /> + </LinearGradientBrush> + </touch:TouchButton.BorderBrush> - <DockPanel LastChildFill="False" Style="{StaticResource Level2ContainerExtraMargin}" Height="40"> - <StackPanel DockPanel.Dock="Left" Orientation="Horizontal"> - <touch:TouchToggleIconButton x:Name="toggle_small_list" IsChecked="{Binding ElementName=toggle_large_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ListSolid" CheckedIcon="ListSolid" Padding="8" CornerRadius="20" /> - <Rectangle HorizontalAlignment="Left" Stroke="{StaticResource TangoDividerBrush}" Margin="10 8" /> - <touch:TouchToggleIconButton x:Name="toggle_large_list" IsChecked="{Binding ElementName=toggle_small_list,Path=IsChecked,Mode=OneWay,Converter={StaticResource BooleanInverseConverter}}" DockPanel.Dock="Right" Icon="ThListSolid" CheckedIcon="ThListSolid" Padding="8" CornerRadius="20" /> + <StackPanel Orientation="Horizontal"> + <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" /> + <TextBlock Margin="10 0 0 0">GRADIENT SEGMENT</TextBlock> + </StackPanel> + </touch:TouchButton> </StackPanel> - <touch:TouchToggleIconButton x:Name="toggleEdit" DockPanel.Dock="Right" Icon="Pencil" CheckedIcon="Pencil" Padding="8" CornerRadius="20" /> - </DockPanel> + <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> + <DockPanel LastChildFill="False"> + <touch:TouchCheckBox DockPanel.Dock="Left" HorizontalAlignment="Left" IsChecked="{Binding Job.EnableInterSegment}">Include white gap between segments</touch:TouchCheckBox> + <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 5 0"> + <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}"> + <Run Text="Length (m):"></Run> + </TextBlock> - <ItemsControl Style="{StaticResource Level2Container}" ItemsSource="{Binding SegmentsCollectionView}" ItemTemplate="{StaticResource Segment_Template}"></ItemsControl> + <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Minimum="1" Maximum="1000" Value="{Binding Job.InterSegmentLength}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> - <StackPanel HorizontalAlignment="Right" Style="{StaticResource Level2Container}" Orientation="Horizontal"> - <touch:TouchButton Command="{Binding AddSolidSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="170" CornerRadius="20" Padding="0 10" Background="Transparent" BorderThickness="2" BorderBrush="{StaticResource TangoPrimaryAccentBrush}"> - <StackPanel Orientation="Horizontal"> - <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" /> - <TextBlock Margin="10 0 0 0">SOLID SEGMENT</TextBlock> - </StackPanel> - </touch:TouchButton> - <touch:TouchButton Command="{Binding AddGradientSegmentCommand}" FontWeight="Normal" RippleBrush="{StaticResource TangoRippleDarkBrush}" FontSize="{StaticResource TangoDefaultFontSize}" Margin="30 0 0 0" EnableDropShadow="False" Foreground="{StaticResource TangoPrimaryAccentBrush}" Padding="0 10" Width="200" CornerRadius="20" Background="Transparent" BorderThickness="2"> - <touch:TouchButton.BorderBrush> - <LinearGradientBrush> - <GradientStop Offset="0" Color="{StaticResource TangoPrimaryAccentColor}" /> - <GradientStop Offset="1" Color="#57F157" /> - </LinearGradientBrush> - </touch:TouchButton.BorderBrush> + <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" /> + </StackPanel> + </DockPanel> + </StackPanel> - <StackPanel Orientation="Horizontal"> - <fa:ImageAwesome Icon="Plus" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="16" Height="16" /> - <TextBlock Margin="10 0 0 0">GRADIENT SEGMENT</TextBlock> - </StackPanel> - </touch:TouchButton> - </StackPanel> + <Rectangle Stroke="{StaticResource TangoDividerBrush}" Margin="0 30 0 0" /> - <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> - <DockPanel LastChildFill="False"> - <touch:TouchCheckBox DockPanel.Dock="Left" HorizontalAlignment="Left" IsChecked="{Binding Job.EnableInterSegment}">Include white gap between segments</touch:TouchCheckBox> - <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 5 0"> - <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}"> - <Run Text="Length (m):"></Run> - </TextBlock> + <StackPanel x:Name="stackOutput" Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> + <Image Source="../Images/JobView/output.png" Width="39" /> + <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Output</TextBlock> + </StackPanel> - <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="50" HorizontalContentAlignment="Center" Minimum="1" Maximum="1000" Value="{Binding Job.InterSegmentLength}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> + <DockPanel Style="{StaticResource Level2Container}"> + <TextBlock Text="Output spool (m):" VerticalAlignment="Center"></TextBlock> + <touch:TouchComboBox ItemsSource="{Binding SpoolTypes}" SelectedItem="{Binding Job.SpoolType}" Margin="40 0 0 0" DisplayMemberPath="Name" Title="Select Output Spool" /> + </DockPanel> - <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" /> - </StackPanel> + <DockPanel Style="{StaticResource Level2Container}"> + <TextBlock Text="Segments per spool:" VerticalAlignment="Center"></TextBlock> + <touch:TouchToggleSlider Margin="30 0 0 0" BorderThickness="2" Height="38" Width="83" HorizontalAlignment="Left" UncheckedContent="One" CheckedContent="All" IsChecked="{Binding Job.IsAllSegmentsPerSpool}" /> </DockPanel> </StackPanel> + </Grid> + </Border> - <Rectangle Stroke="{StaticResource TangoDividerBrush}" Margin="0 30 0 0" /> - + <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/output.png" Width="39" /> - <TextBlock FontWeight="Medium" Margin="20 0 0 0" VerticalAlignment="Center" FontSize="{StaticResource TangoExpanderHeaderFontSize}">Output</TextBlock> + <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> - <DockPanel Style="{StaticResource Level2Container}"> - <TextBlock Text="Output spool (m):" VerticalAlignment="Center"></TextBlock> - <touch:TouchComboBox ItemsSource="{Binding SpoolTypes}" SelectedItem="{Binding Job.SpoolType}" Margin="40 0 0 0" DisplayMemberPath="Name" Title="Select Output Spool" /> - </DockPanel> - - <DockPanel Style="{StaticResource Level2Container}"> - <TextBlock Text="Segments per spool:" VerticalAlignment="Center"></TextBlock> - <touch:TouchToggleSlider Margin="30 0 0 0" BorderThickness="2" Height="38" Width="83" HorizontalAlignment="Left" UncheckedContent="One" CheckedContent="All" IsChecked="{Binding Job.IsAllSegmentsPerSpool}" /> - </DockPanel> - </StackPanel> - </Grid> - </Border> - - <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> - - <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> - <Grid> - <localControls:JobSummeryViewer DataContext="{Binding Job}" /> - </Grid> + <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> + <Grid> + <localControls:JobSummeryViewer DataContext="{Binding Job}" /> + </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 0 5 0"> - <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}"> + <StackPanel DockPanel.Dock="Right" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 5 0"> + <TextBlock Margin="0 3 0 0" Foreground="{StaticResource TangoGrayTextBrush}"> <Run Text="Factor: +"></Run> - </TextBlock> + </TextBlock> - <touch:TouchNumericTextBox Foreground="{StaticResource TangoGrayTextBrush}" Margin="5 0 0 0" Width="30" 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="30" HorizontalContentAlignment="Center" Maximum="100" Minimum="0" Value="{Binding Job.LengthPercentageFactor}" KeyboardContainer="{Binding ElementName=Container}" StringFormat="0" FocusSelectionMode="SelectAll" /> - <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}">%</TextBlock> + <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}">%</TextBlock> - <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" /> - </StackPanel> - </DockPanel> + <Image Margin="10 0 0 0" Source="../Images/JobView/settings.png" /> + </StackPanel> + </DockPanel> + </StackPanel> </StackPanel> - </StackPanel> - </Border> + </Border> - <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> - </StackPanel> + <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> + </StackPanel> - <!--<Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> + <!--<Border Style="{StaticResource TangoTouchBorder}" Margin="0 12 0 0" Padding="0 0 0 40"> <StackPanel> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Style="{StaticResource Level1Container}"> <Image Source="../Images/JobView/additional-tools.png" Width="39" /> @@ -592,286 +611,199 @@ </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: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}"> - 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}"> - <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> + </touch:TouchExpander> - <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> - - <StackPanel HorizontalAlignment="Center" Margin="0 40 0 0"> - <TextBlock Foreground="{StaticResource TangoGrayTextBrush}" HorizontalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}">Defined Colors</TextBlock> + <touch:TouchExpander x:Name="expander_fine_tuning" Margin="0 20 0 120" Padding="20 15" IsExpanded="{Binding IsFineTuneExpanded,Mode=TwoWay}"> + <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="../Images/JobView/color-picker.png" 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}"> - 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="../Images/JobView/color-picker.png" 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> @@ -925,72 +857,166 @@ </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> + </StackPanel> </StackPanel> - </StackPanel> - </touch:LightTouchScrollViewer> + </touch:LightTouchScrollViewer> + </Grid> + + <Border VerticalAlignment="Top" x:Name="borderEditDock" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="0 0 0 1" BorderBrush="{StaticResource TangoDividerBrush}" Padding="0 0 0 10"> + <Border.Effect> + <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" BlurRadius="20" /> + </Border.Effect> + </Border> </Grid> <Grid Grid.Row="1"> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs index 90be80a84..72e13d5c7 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -23,15 +24,16 @@ namespace Tango.PPC.Jobs.Views /// <summary> /// Interaction logic for JobView.xaml /// </summary> - public partial class JobView : UserControl ,INavigationView, IJobView + public partial class JobView : UserControl, INavigationView, IJobView { private JobViewVM _vm; + private bool _is_edit_docked; public JobView() { InitializeComponent(); - Loaded += (_, __) => + Loaded += (_, __) => { _vm = DataContext as JobViewVM; }; @@ -41,6 +43,7 @@ namespace Tango.PPC.Jobs.Views public void OnNavigatedTo() { + FloatEditing(); scrollViewer.ScrollToTop(); } @@ -65,7 +68,48 @@ namespace Tango.PPC.Jobs.Views public void OnNavigatedFrom() { - + + } + + private void scrollViewer_Scrolling(object sender, Touch.Controls.DoubleValueChangedEventArgs e) + { + if (_vm.Job.Segments.Count > 3) + { + var position = scrollViewer.GetElementPosition(listSegments); + var stackOutputPosition = scrollViewer.GetElementPosition(stackOutput); + + if (stackOutputPosition.Y > 100) + { + if (position.Y < 110 && !_is_edit_docked) + { + DockEditing(); + } + else if (position.Y > 110 && _is_edit_docked) + { + FloatEditing(); + } + } + else + { + borderEditDock.Visibility = Visibility.Collapsed; + } + } + } + + private void DockEditing() + { + _is_edit_docked = true; + borderDockFloat.Child = null; + borderEditDock.Child = dockEdit; + borderEditDock.Visibility = Visibility.Visible; + } + + private void FloatEditing() + { + _is_edit_docked = false; + borderEditDock.Child = null; + borderDockFloat.Child = dockEdit; + borderEditDock.Visibility = Visibility.Collapsed; } } } |
