diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-12-28 00:50:47 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-12-28 00:50:47 +0200 |
| commit | 028cca5fd51b4e5edb183e41e4e6831028a39e44 (patch) | |
| tree | eda1e3ac087073eaba532ddb3a977dd51cccd853 /Software/Visual_Studio/PPC | |
| parent | ad969db71a39b4854d744412eb6482c0391a4dd9 (diff) | |
| parent | 0fdbc932838bb6e007cfa8a0079d1880c800ed81 (diff) | |
| download | Tango-028cca5fd51b4e5edb183e41e4e6831028a39e44.tar.gz Tango-028cca5fd51b4e5edb183e41e4e6831028a39e44.zip | |
Merged Urgent-Color-Space Branch.
Diffstat (limited to 'Software/Visual_Studio/PPC')
7 files changed, 379 insertions, 369 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml index afe331145..bd0bbfd11 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml @@ -3,11 +3,12 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL" xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL" xmlns:local="clr-namespace:Tango.PPC.Jobs.Controls" mc:Ignorable="d" - d:DesignHeight="60" d:DesignWidth="500" Height="38" d:DataContext="{d:DesignInstance Type=entities:Job, IsDesignTimeCreatable=False}" x:Name="control"> + d:DesignHeight="60" d:DesignWidth="500" Height="38" x:Name="control"> <Grid> <Grid.ColumnDefinitions> @@ -20,7 +21,7 @@ <RowDefinition Height="1*" /> </Grid.RowDefinitions> - <ItemsControl ClipToBounds="False" ItemsSource="{Binding EffectiveSegments,IsAsync=True}" Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DisplayMarkers,Converter={StaticResource BooleanToVisibilityConverter}}"> + <ItemsControl ClipToBounds="False" ItemsSource="{Binding ElementName=control,Path=Job.EffectiveSegments}" Visibility="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DisplayMarkers,Converter={StaticResource BooleanToVisibilityConverter}}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> @@ -31,15 +32,15 @@ <Grid x:Name="grid"> <Grid.Width> <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Length"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="Job.Length"></Binding> <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> <Binding Path="LengthWithFactor"></Binding> </MultiBinding> </Grid.Width> - <TextBlock HorizontalAlignment="Center" FontSize="{StaticResource TangoSmallFontSize}"> - <TextBlock.Style> - <Style TargetType="TextBlock"> + <DockPanel HorizontalAlignment="Center" TextElement.FontSize="{StaticResource TangoSmallFontSize}"> + <DockPanel.Style> + <Style TargetType="DockPanel"> <Setter Property="Visibility" Value="Visible"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=grid,Path=ActualWidth,Converter={StaticResource SmallerThanToBooleanConverter},ConverterParameter=20}" Value="True"> @@ -47,9 +48,10 @@ </DataTrigger> </Style.Triggers> </Style> - </TextBlock.Style> - <Run Text="{Binding LengthWithFactor,Mode=OneWay,StringFormat=N0,IsAsync=True}"></Run><Run Text="m"></Run> - </TextBlock> + </DockPanel.Style> + <controls:FastTextBlock Text="{Binding LengthWithFactor,Mode=OneWay,StringFormat=N0}" /> + <controls:FastTextBlock Text="m" /> + </DockPanel> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> @@ -66,11 +68,8 @@ </RectangleGeometry.Rect> </RectangleGeometry> </Border.Clip> - <Border.Background> - <ImageBrush ImageSource="../Images/JobView/transparent_small.jpg" Stretch="None" TileMode="Tile" AlignmentX="Left" ViewportUnits="Absolute" Viewport="0,0,94,30" /> - </Border.Background> <Grid> - <ItemsControl ClipToBounds="False" ItemsSource="{Binding EffectiveSegments,IsAsync=True}"> + <ItemsControl ClipToBounds="False" ItemsSource="{Binding ElementName=control,Path=Job.EffectiveSegments}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" ClipToBounds="False"></StackPanel> @@ -81,7 +80,7 @@ <Grid> <Grid.Width> <MultiBinding Converter="{StaticResource SegmentLengthToWidthConverter}"> - <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="DataContext.Length"></Binding> + <Binding RelativeSource="{RelativeSource AncestorType=UserControl}" Path="Job.Length"></Binding> <Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding> <Binding Path="LengthWithFactor"></Binding> </MultiBinding> @@ -104,7 +103,7 @@ <Style.Triggers> <MultiDataTrigger> <MultiDataTrigger.Conditions> - <Condition Binding="{Binding JobType}" Value="{x:Static enumerations:JobTypes.Embroidery}" /> + <Condition Binding="{Binding ElementName=control,Path=Job.JobType}" Value="{x:Static enumerations:JobTypes.Embroidery}" /> <Condition Binding="{Binding ElementName=control,Path=IsActive}" Value="False" /> </MultiDataTrigger.Conditions> <Setter Property="Visibility" Value="Visible"></Setter> @@ -114,7 +113,7 @@ </Grid.Style> <TextBlock Margin="10 0 0 -2" VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}"> - <Run Text="x"></Run><Run Text="{Binding NumberOfUnits}"></Run> + <Run Text="x"></Run><Run Text="{Binding ElementName=control,Path=Job.NumberOfUnits}"></Run> </TextBlock> </Grid> </Grid> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml.cs index 1c0b90f91..c977e71d0 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Controls/JobSummeryViewer.xaml.cs @@ -23,6 +23,18 @@ namespace Tango.PPC.Jobs.Controls /// <seealso cref="System.Windows.Markup.IComponentConnector" /> public partial class JobSummeryViewer : UserControl { + + /// <summary> + /// Gets or sets the job. + /// </summary> + public Job Job + { + get { return (Job)GetValue(JobProperty); } + set { SetValue(JobProperty, value); } + } + public static readonly DependencyProperty JobProperty = + DependencyProperty.Register("Job", typeof(Job), typeof(JobSummeryViewer), new PropertyMetadata(null)); + /// <summary> /// Maybe not necessary! /// </summary> 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 5e90d3b5b..cfac759dd 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 @@ -37,6 +37,7 @@ using Tango.PPC.Storage; using System.IO; using Tango.ColorConversion; using Tango.Integration.Operation; +using Tango.BL.Enumerations; namespace Tango.PPC.Jobs.ViewModels { @@ -188,39 +189,16 @@ namespace Tango.PPC.Jobs.ViewModels set { _isJobDetailsExpanded = value; RaisePropertyChangedAuto(); } } - private List<ColorCatalogsItem> _catalogItems; - /// <summary> - /// Gets or sets the twine catalog items. - /// </summary> - public List<ColorCatalogsItem> CatalogItems - { - get { return _catalogItems; } - set { _catalogItems = value; RaisePropertyChangedAuto(); } - } - - private ColorCatalogsItem _selectedCatalogItem; - /// <summary> - /// Gets or sets the selected catalog item. - /// </summary> - public ColorCatalogsItem SelectedCatalogItem - { - get { return _selectedCatalogItem; } - set { _selectedCatalogItem = value; RaisePropertyChangedAuto(); } - } - /// <summary> /// Gets or sets the twine catalog automatic complete provider. /// </summary> public IAutoCompleteProvider CatalogAutoCompleteProvider { get; set; } - private ColorCatalog _selectedCatalog; - /// <summary> - /// Gets or sets the selected catalog. - /// </summary> - public ColorCatalog SelectedCatalog + private List<ColorCatalog> _availableCatalogs; + public List<ColorCatalog> AvailableCatalogs { - get { return _selectedCatalog; } - set { _selectedCatalog = value; RaisePropertyChangedAuto(); } + get { return _availableCatalogs; } + set { _availableCatalogs = value; RaisePropertyChangedAuto(); } } #endregion @@ -362,7 +340,6 @@ namespace Tango.PPC.Jobs.ViewModels FineTuneItems = new ObservableCollection<FineTuneItem>(); ApprovalFineTuneItems = new ObservableCollection<FineTuneItem>(); - CatalogItems = new List<ColorCatalogsItem>(); CustomersAutoCompleteProvider = new AutoCompleteProvider<Customer>((customer, filter) => { @@ -445,6 +422,14 @@ namespace Tango.PPC.Jobs.ViewModels if (_db != null) { + if (Job != null) + { + foreach (var stop in Job.Segments.SelectMany(x => x.BrushStops).ToList()) + { + stop.ColorSpaceChanged -= Stop_ColorSpaceChanged; + } + } + Rmls.ForEach(x => x.Cct = null); Rmls = null; _db.Dispose(); @@ -471,33 +456,17 @@ namespace Tango.PPC.Jobs.ViewModels LogManager.Log("Loading RMLS..."); Rmls = (await new RmlsCollectionBuilder(_db).SetAll().WithActiveParametersGroup().WithCAT(Job.MachineGuid).WithCCT().WithLiquidFactors().WithSpools().ForHeadType(MachineProvider.Machine.MachineHeadType).ForSite(MachineProvider.Machine.SiteGuid).BuildAsync()).ToList(); LogManager.Log("Loading Color Spaces..."); - ColorSpaces = await _db.ColorSpaces.ToListAsync(); + ColorSpaces = await _db.ColorSpaces.Where(x => x.Code != (int)BL.Enumerations.ColorSpaces.CMYK).ToListAsync(); LogManager.Log("Loading Spool Types..."); SpoolTypes = await _db.SpoolTypes.ToListAsync(); LogManager.Log("Loading Customers..."); Customers = await _db.Customers.Where(x => x.OrganizationGuid == MachineProvider.Machine.OrganizationGuid).ToListAsync(); - if (Job.ColorSpace.Space == BL.Enumerations.ColorSpaces.Catalog) - { - SelectedCatalog = await new CatalogBuilder(_db).Set(Job.ColorCatalogGuid).WithGroups().WithItems().BuildAsync(); - - if (SelectedCatalog != null) - { - CatalogItems = SelectedCatalog.ColorCatalogsGroups.SelectMany(x => x.ColorCatalogsItems).OrderBy(x => x.ItemIndex).ToList(); - } - else - { - await NotificationProvider.ShowError("The selected color catalog for this job could not be found.\nCannot load job."); - Job = null; - _can_navigate_back = true; - await NavigationManager.NavigateBack(); - return; - } - } + AvailableCatalogs = await new CatalogsCollectionBuilder(_db).SetAll().WithGroups().WithItems().ForSite(MachineProvider.Machine.SiteGuid).BuildListAsync(); foreach (var segment in Job.Segments) { - SetSegmentLiquidVolumesIfVolume(segment); + SetSegmentLiquidVolumes(segment); } if (!_check_gamut_thread.IsAlive) @@ -540,6 +509,8 @@ namespace Tango.PPC.Jobs.ViewModels ValidateBrushStops(); + CoerceBrushStopsColorSpaceChange(); + DyeCommand.RaiseCanExecuteChanged(); StartSampleDyeCommand.RaiseCanExecuteChanged(); StartFineTuningCommand.RaiseCanExecuteChanged(); @@ -718,7 +689,8 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log("Adding new solid segment..."); var s = Job.AddSolidSegment(Settings.DefaultSegmentLength > 0 ? Settings.DefaultSegmentLength : 10); - SetSegmentLiquidVolumesIfVolume(s); + SetSegmentLiquidVolumes(s); + CoerceBrushStopsColorSpaceChange(); return s; } catch (Exception ex) @@ -738,7 +710,8 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log("Adding new gradient segment..."); var s = Job.AddGradientSegment(Settings.DefaultSegmentLength > 0 ? Settings.DefaultSegmentLength : 10); - SetSegmentLiquidVolumesIfVolume(s); + SetSegmentLiquidVolumes(s); + CoerceBrushStopsColorSpaceChange(); return s; } catch (Exception ex) @@ -811,19 +784,16 @@ namespace Tango.PPC.Jobs.ViewModels /// Sets the segment liquid volumes. /// </summary> /// <param name="segment">The segment.</param> - private void SetSegmentLiquidVolumesIfVolume(Segment segment) + private void SetSegmentLiquidVolumes(Segment segment) { - if (Job.ColorSpace.Code == BL.Enumerations.ColorSpaces.Volume.ToInt32()) + foreach (var stop in segment.BrushStops) { - foreach (var stop in segment.BrushStops) - { - stop.SetLiquidVolumes(Job.Machine.Configuration, Job.Rml, Job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault()); + stop.SetLiquidVolumes(Job.Machine.Configuration, Job.Rml, Job.Rml.GetActiveProcessGroup().ProcessParametersTables.FirstOrDefault()); - var lub = stop.LiquidVolumes.FirstOrDefault(x => x.IdsPack.LiquidType.Code == (int)BL.Enumerations.LiquidTypes.Lubricant); - if (lub != null) - { - lub.Volume = 100; - } + var lub = stop.LiquidVolumes.FirstOrDefault(x => x.IdsPack.LiquidType.Code == (int)BL.Enumerations.LiquidTypes.Lubricant); + if (lub != null) + { + lub.Volume = 100; } } } @@ -844,6 +814,24 @@ namespace Tango.PPC.Jobs.ViewModels #region Brush Stops Management + private void CoerceBrushStopsColorSpaceChange() + { + if (Job != null) + { + foreach (var stop in Job.Segments.SelectMany(x => x.BrushStops).ToList()) + { + stop.ColorSpaceChanged -= Stop_ColorSpaceChanged; + stop.ColorSpaceChanged += Stop_ColorSpaceChanged; + } + } + } + + private void Stop_ColorSpaceChanged(object sender, ColorSpace e) + { + BrushStop stop = sender as BrushStop; + stop.Segment.BrushStops.Where(x => x != stop).ToList().ForEach(x => x.ColorSpace = stop.ColorSpace); + } + /// <summary> /// Adds a new brush stop to the specified segment. /// </summary> @@ -852,7 +840,8 @@ namespace Tango.PPC.Jobs.ViewModels { LogManager.Log($"Adding new brush stop to segment {segment.SegmentIndex}."); segment.AddBrushStop(); - SetSegmentLiquidVolumesIfVolume(segment); + SetSegmentLiquidVolumes(segment); + CoerceBrushStopsColorSpaceChange(); } /// <summary> @@ -987,34 +976,56 @@ namespace Tango.PPC.Jobs.ViewModels { if (stop != null && stop.ColorSpace != null) { - stop.Corrected = false; - stop.OutOfGamutChecked = false; + if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.Catalog) return; - if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.Volume) + _volumeConversionTimer.ResetReplace(() => { - _volumeConversionTimer.ResetReplace(() => + + try { - try - { - var output = _converter.Convert(stop, false); + var output = _converter.Convert(stop, false); + if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.Volume) + { stop.Red = output.SingleCoordinates.Red; stop.Green = output.SingleCoordinates.Green; stop.Blue = output.SingleCoordinates.Blue; + stop.L = output.SingleCoordinates.L; + stop.A = output.SingleCoordinates.A; + stop.B = output.SingleCoordinates.B; stop.Corrected = true; stop.IsOutOfGamut = false; - - InvokeUI(() => - { - DyeCommand.RaiseCanExecuteChanged(); - }); } - catch (Exception ex) + else if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.LAB) { - LogManager.Log(ex, "An error occurred while trying to get volume => RGB from conversion engine."); + output.ApplyOnBrushStopVolumesOnly(stop); + stop.Corrected = false; + stop.OutOfGamutChecked = false; } - }); - } + else if (stop.BrushColorSpace == BL.Enumerations.ColorSpaces.RGB) + { + output.ApplyOnBrushStopVolumesOnly(stop); + stop.Corrected = false; + stop.OutOfGamutChecked = false; + } + + try + { + var closestItem = AvailableCatalogs.SelectMany(x => x.AllItemsOrdered).GetClosestItem(stop.Color); + stop.ColorCatalog = closestItem.ColorCatalogsGroup.ColorCatalog; + stop.ColorCatalogsItem = closestItem; + } + catch { } + + InvokeUI(() => DyeCommand.RaiseCanExecuteChanged()); + } + catch (Exception ex) + { + LogManager.Log(ex, "An error occurred while trying to get volume => RGB from conversion engine."); + } + + }); + } } @@ -1027,7 +1038,7 @@ namespace Tango.PPC.Jobs.ViewModels var catalogItem = await NavigationManager.NavigateForResult<JobsModule, TwineCatalogView, ColorCatalogsItem, TwineCatalogNavigationObject>(new TwineCatalogNavigationObject() { SelectedItem = stop.ColorCatalogsItem, - Catalog = SelectedCatalog + Catalog = stop.ColorCatalog }, true); if (catalogItem != null) @@ -1298,9 +1309,9 @@ namespace Tango.PPC.Jobs.ViewModels { Thread.Sleep(500); - if (Job != null && Job.Rml.Cct != null && IsVisible && (Job.ColorSpace != null && (Job.ColorSpace.Code == BL.Enumerations.ColorSpaces.RGB.ToInt32() || Job.ColorSpace.Code == BL.Enumerations.ColorSpaces.LAB.ToInt32()))) + if (Job != null && Job.Rml.Cct != null && IsVisible) { - var brushStops = Job.Segments.SelectMany(x => x.BrushStops).Where(x => !x.Corrected && !x.OutOfGamutChecked).ToList(); + var brushStops = Job.Segments.SelectMany(x => x.BrushStops).Where(x => (x.BrushColorSpace == BL.Enumerations.ColorSpaces.LAB || x.BrushColorSpace == BL.Enumerations.ColorSpaces.RGB) && !x.Corrected && !x.OutOfGamutChecked).ToList(); foreach (var stop in brushStops) { 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 4ae98b1d0..6440f7e46 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 @@ -314,11 +314,11 @@ namespace Tango.PPC.Jobs.ViewModels /// <param name="job">The job.</param> public async void SelectJob(Job job, bool directlyToEdit = false) { - if (!ApplicationManager.IsInTechnicianMode && job.ColorSpace != null && job.ColorSpace.Code == ColorSpaces.Volume.ToInt32()) - { - await NotificationProvider.ShowError("The selected job is supported only in technician mode."); - return; - } + //if (!ApplicationManager.IsInTechnicianMode && job.ColorSpace != null && job.ColorSpace.Code == ColorSpaces.Volume.ToInt32()) + //{ + // await NotificationProvider.ShowError("The selected job is supported only in technician mode."); + // return; + //} LogManager.Log($"Job '{job.Name}' selected."); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml index 4785805a6..ddda98df9 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobSummeryView.xaml @@ -92,7 +92,7 @@ </UniformGrid> </Grid> - <controls:JobSummeryViewer Height="40" DataContext="{Binding Job}" VerticalAlignment="Center" Margin="20 0" Grid.Row="2" /> + <controls:JobSummeryViewer Height="40" Job="{Binding Job}" VerticalAlignment="Center" Margin="20 0" Grid.Row="2" /> </Grid> </DockPanel> </Border> 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 6a94034db..c1472793a 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 @@ -51,7 +51,7 @@ <ItemsControl.ItemTemplate> <DataTemplate> <Border> - <touch:TouchNumericTextBox DisplayWatermarkHint="True" Width="50" Watermark="{Binding IdsPack.LiquidType.Name,IsAsync=True}" Margin="2 0" ValueChanged="OnLiquidVolumeFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Volume}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="0" Maximum="200" JoggingFactor="0.5" StringFormat="0.0" /> + <touch:TouchNumericTextBox DisplayWatermarkHint="True" Width="50" Watermark="{Binding IdsPack.LiquidType.Name}" Margin="2 0" ValueChanged="OnLiquidVolumeFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Volume}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="0" Maximum="200" JoggingFactor="0.5" StringFormat="0.0" /> </Border> </DataTemplate> </ItemsControl.ItemTemplate> @@ -65,33 +65,34 @@ <DataTemplate x:Key="RGB_Template" DataType="{x:Type entities:BrushStop}"> <UniformGrid Rows="1" Columns="3"> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Red}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" /> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Green}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" /> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Blue}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Red}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Green}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Blue}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" Maximum="255" /> </UniformGrid> </DataTemplate> <DataTemplate x:Key="CMYK_Template" DataType="{x:Type entities:BrushStop}"> <UniformGrid Rows="1" Columns="4"> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Cyan,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" /> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Magenta,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" /> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Yellow,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" /> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Black,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Cyan,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Magenta,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Yellow,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding Black,Converter={StaticResource OneToPercentConverter}}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Maximum="100" StringFormat="0" /> </UniformGrid> </DataTemplate> <DataTemplate x:Key="LAB_Template" DataType="{x:Type entities:BrushStop}"> <UniformGrid Rows="1" Columns="3"> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding L}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="0" Maximum="100" StringFormat="0.00" /> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding A}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="-128" Maximum="128" StringFormat="0.00" /> - <touch:TouchNumericTextBox Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding B}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="-128" Maximum="128" StringFormat="0.00" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding L}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="0" Maximum="100" StringFormat="0.00" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding A}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="-128" Maximum="128" StringFormat="0.00" /> + <touch:TouchNumericTextBox UpdateBindingOnlyWhenFocused="True" Margin="2 0" ValueChanged="OnBrushStopFieldValueChanged" HorizontalContentAlignment="Center" Value="{Binding B}" keyboard:KeyboardView.Container="{Binding ElementName=Container}" HasDecimalPoint="True" Minimum="-128" Maximum="128" StringFormat="0.00" /> </UniformGrid> </DataTemplate> <DataTemplate x:Key="CATALOG_Template" DataType="{x:Type entities:BrushStop}"> - <DockPanel> + <DockPanel Margin="0 0 -90 0"> + <touch:TouchComboBox DockPanel.Dock="Left" ItemsSource="{Binding ElementName=view,Path=DataContext.AvailableCatalogs}" SelectedItem="{Binding ColorCatalog}" DisplayMemberPath="Name" Title="Select Catalog" Width="130" Margin="0 0 10 0" /> <touch:TouchIconButton Margin="0 0 -50 -10" CornerRadius="50" Width="50" Height="50" Padding="13" RippleBrush="{StaticResource TangoRippleDarkBrush}" DockPanel.Dock="Right" Icon="Palette" Foreground="{StaticResource TangoPrimaryAccentBrush}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.OpenCatalogCommand}" CommandParameter="{Binding}"></touch:TouchIconButton> - <touch:TouchAutoComplete Margin="2 0" ItemsSource="{Binding ElementName=view,Path=DataContext.CatalogItems}" Watermark="Color Code" PopupHeight="250" DisplayMemberPath="Name" AutoCompleteProvider="{Binding ElementName=view,Path=DataContext.CatalogAutoCompleteProvider}" SelectedItem="{Binding ColorCatalogsItem,Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" keyboard:KeyboardView.Container="{Binding ElementName=Container}"> + <touch:TouchAutoComplete Margin="2 0" ItemsSource="{Binding ColorCatalog.AllItemsOrdered}" Watermark="Color Code" PopupHeight="250" DisplayMemberPath="Name" AutoCompleteProvider="{Binding ElementName=view,Path=DataContext.CatalogAutoCompleteProvider}" SelectedItem="{Binding ColorCatalogsItem,Mode=TwoWay,ValidatesOnDataErrors=True,ValidatesOnNotifyDataErrors=True}" keyboard:KeyboardView.Container="{Binding ElementName=Container}"> <touch:TouchAutoComplete.ItemTemplate> <DataTemplate> <DockPanel Margin="2"> @@ -117,11 +118,11 @@ <Style TargetType="Border"> <Setter Property="Background"> <Setter.Value> - <SolidColorBrush Color="{Binding Color,IsAsync=True}" /> + <SolidColorBrush Color="{Binding Color}" /> </Setter.Value> </Setter> <Style.Triggers> - <DataTrigger Binding="{Binding IsTransparent,IsAsync=True}" Value="True" > + <DataTrigger Binding="{Binding IsTransparent}" Value="True" > <Setter Property="Background"> <Setter.Value> <ImageBrush ImageSource="{StaticResource Image_TransparentSmall}" Stretch="None" /> @@ -149,44 +150,33 @@ </Setter.Value> </Setter> <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="RGB"> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB"> <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="CMYK"> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="CMYK"> <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="LAB"> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="LAB"> <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Catalog"> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Catalog"> <Setter Property="ContentTemplate" Value="{StaticResource CATALOG_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Volume"> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Volume"> <Setter Property="ContentTemplate" Value="{StaticResource Volume_Template}" /> </DataTrigger> - <DataTrigger Binding="{Binding IsTransparent,IsAsync=True}" Value="True"> - <Setter Property="ContentTemplate"> - <Setter.Value> - <DataTemplate> - <Grid Height="40"> - <TextBlock VerticalAlignment="Bottom" Foreground="{StaticResource TangoGrayBrush}">Transparent</TextBlock> - </Grid> - </DataTemplate> - </Setter.Value> - </Setter> - </DataTrigger> </Style.Triggers> </Style> </ContentControl.Style> </ContentControl> </DockPanel> - <Canvas Visibility="{Binding IsOutOfGamut,IsAsync=True,Converter={StaticResource BooleanToVisibilityConverter}}"> + <Canvas Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> <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" IsEnabled="{Binding IsMiddle}"> - <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Position (m):</TextBlock> + <controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Position (m):</controls:FastTextBlock> <Grid Margin="20 0 0 0" Width="300" DockPanel.Dock="Right"> <Grid.ColumnDefinitions> <ColumnDefinition Width="1*" /> @@ -200,280 +190,271 @@ </StackPanel> <StackPanel Orientation="Horizontal" Margin="0 0 -130 0" HorizontalAlignment="Right" VerticalAlignment="Top"> - <StackPanel Orientation="Horizontal" Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,IsAsync=True,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> - <!--<touch:TouchToggleIconButton Padding="15" Width="60" Height="60" CornerRadius="30" Icon="EyeOutline" CheckedIcon="EyeOffOutline" Foreground="{StaticResource TangoGrayBrush}" CheckedForeground="{StaticResource TangoGrayBrush}" IsChecked="{Binding IsTransparent,IsAsync=True}"></touch:TouchToggleIconButton>--> - <touch:TouchImageButton Command="{Binding ElementName=view,Path=DataContext.ReplaceBrushStopCommand,IsAsync=True}" CommandParameter="{Binding}" Visibility="{Binding ColorSpace,Converter={StaticResource ColorSpaceToVisibilityConverter},IsAsync=True}" Width="50" Height="50" Padding="10" Image="{StaticResource Image_Replace_Color}" CornerRadius="30"></touch:TouchImageButton> + <StackPanel Orientation="Horizontal" Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> + <!--<touch:TouchToggleIconButton Padding="15" Width="60" Height="60" CornerRadius="30" Icon="EyeOutline" CheckedIcon="EyeOffOutline" Foreground="{StaticResource TangoGrayBrush}" CheckedForeground="{StaticResource TangoGrayBrush}" IsChecked="{Binding IsTransparent}"></touch:TouchToggleIconButton>--> + <touch:TouchImageButton Command="{Binding ElementName=view,Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding}" Visibility="{Binding ColorSpace,Converter={StaticResource ColorSpaceToVisibilityConverter}}" Width="50" Height="50" Padding="10" Image="{StaticResource Image_Replace_Color}" CornerRadius="30"></touch:TouchImageButton> </StackPanel> - <touch:TouchIconButton Margin="0 0 50 0" Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding ElementName=view,Path=DataContext.RemoveBrushStopCommand,IsAsync=True}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> + <touch:TouchIconButton Margin="0 0 50 0" Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding ElementName=view,Path=DataContext.RemoveBrushStopCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashAltRegular" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> </StackPanel> </Grid> </DataTemplate> <DataTemplate x:Key="Segment_Template" DataType="{x:Type entities:Segment}"> - <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> - <Style.Triggers> - <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked,IsAsync=True}" Value="True"> - <Setter Property="Height" Value="74"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </DockPanel.Style> - - <Border DockPanel.Dock="Left" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoLightBorderBrush}"> - <Border.Background> - <ImageBrush ImageSource="{StaticResource Image_Transparent}" Stretch="None" /> - </Border.Background> - <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> + <touch:TouchVirtualizedContentReplaceControl Margin="0 0 0 15" MinHeight="165" Disconnect="False"> + <touch:TouchVirtualizedContentReplaceControl.Content> + <DataTemplate> + <Border RenderOptions.EdgeMode="Unspecified" CornerRadius="8" Background="{StaticResource TangoPrimaryBackgroundBrush}" BorderThickness="1" BorderBrush="{StaticResource TangoGrayBrush}"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid Background="Transparent" dragAndDrop:DragAndDropService.DropCommand="{Binding RelativeSource={RelativeSource AncestorType=UserControl},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="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> + <Trigger Property="dragAndDrop:DragAndDropService.IsDraggableOver" Value="True"> + <Setter Property="Opacity" Value="0.5"></Setter> + </Trigger> </Style.Triggers> </Style> - </Border.Style> - <Border Background="{Binding SegmentBrush}"> - <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> + <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked}" Value="True"> + <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> - </Border> + </DockPanel.Style> - <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> + <Border DockPanel.Dock="Left" BorderThickness="0 0 1 0" BorderBrush="{StaticResource TangoLightBorderBrush}"> + <!--<Border.Background> + <ImageBrush ImageSource="{StaticResource Image_Transparent}" Stretch="None" /> + </Border.Background>--> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="CornerRadius" Value="8 0 0 8"></Setter> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked}" Value="True"> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,Converter={StaticResource MathOperatorConverter},ConverterParameter='*2'}"></Setter> + </DataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="True"></Condition> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="CornerRadius" Value="8 0 0 0"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + <Border Background="{Binding SegmentBrush}"> + <Border.Style> + <Style TargetType="Border"> + <Setter Property="CornerRadius" Value="8 0 0 8"></Setter> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ElementName=toggle_small_list,Path=IsChecked}" Value="True"> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight,Converter={StaticResource MathOperatorConverter},ConverterParameter='*2'}"></Setter> + </DataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="True"></Condition> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True"></Condition> + </MultiDataTrigger.Conditions> + <Setter Property="CornerRadius" Value="8 0 0 0"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Border.Style> + </Border> + </Border> <Grid> - <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> + <DockPanel Margin="30 0" VerticalAlignment="Center"> + <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> + <Canvas Visibility="{Binding HasOutOfGamutBrushStop,Converter={StaticResource BooleanToVisibilityConverter}}"> + <Image Canvas.Left="-25" Canvas.Top="1" Source="{StaticResource Image_Out_Of_Gamut}" Width="19" Height="19" /> + </Canvas> + <DockPanel> + <controls:FastTextBlock FontSize="{StaticResource TangoTitleFontSize}">Segment #</controls:FastTextBlock> + <controls:FastTextBlock FontSize="{StaticResource TangoTitleFontSize}" Text="{Binding SegmentIndex,Mode=OneWay}"></controls:FastTextBlock> + </DockPanel> + </StackPanel> - <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> + <Grid> + <StackPanel Margin="0 5 0 0" HorizontalAlignment="Left" Width="300" Visibility="{Binding ElementName=toggle_large_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}"> + <DockPanel LastChildFill="False" Margin="0 0 0 0"> + <controls:FastTextBlock Text="Color space:" VerticalAlignment="Bottom"></controls:FastTextBlock> + <touch:TouchComboBox DockPanel.Dock="Right" ItemsSource="{Binding ElementName=view,Path=DataContext.ColorSpaces}" SelectedItem="{Binding BrushStops[0].ColorSpace}" DisplayMemberPath="Name" Title="Select Color Space" Width="179" HorizontalAlignment="Right" /> + </DockPanel> + <DockPanel LastChildFill="False" Margin="0 5 0 0"> + <DockPanel.Style> + <Style TargetType="DockPanel"> + <Setter Property="Visibility" Value="Visible"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="True"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </DockPanel.Style> + <controls:FastTextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left" Text="Color code:"></controls:FastTextBlock> - </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="Catalog"> - <Setter Property="ContentTemplate" Value="{StaticResource CATALOG_Template}" /> - </DataTrigger> - <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="Volume"> - <Setter Property="ContentTemplate" Value="{StaticResource Volume_Template}" /> - </DataTrigger> - <DataTrigger Binding="{Binding IsTransparent,IsAsync=True}" Value="True"> + <Grid DockPanel.Dock="Right" DataContext="{Binding BrushStops[0]}"> + <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> - <Grid Height="40"> - <TextBlock VerticalAlignment="Bottom" Foreground="{StaticResource TangoGrayBrush}">Transparent</TextBlock> - </Grid> + </DataTemplate> </Setter.Value> </Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> - </StackPanel> - </Grid> - </DockPanel> - <Canvas> - <Canvas.Style> - <Style TargetType="Canvas"> + <Style.Triggers> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="RGB"> + <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="CMYK"> + <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="LAB"> + <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" Value="Catalog"> + <Setter Property="ContentTemplate" Value="{StaticResource CATALOG_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding ColorSpace.Name}" 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}}" Value="False" /> + <Condition Binding="{Binding BrushStops[0].IsOutOfGamut}" 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 0 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> + </Grid> + </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}}" 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 ElementName=toggleEdit,Path=IsChecked}" Value="True"> + <Setter Property="Margin" Value="0 5 20 0"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + + <StackPanel Orientation="Horizontal"> + <StackPanel.Style> + <Style TargetType="StackPanel"> <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" /> + <Condition Binding="{Binding ElementName=toggleEdit,Path=IsChecked}" Value="False" /> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True" /> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="False" /> </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> - </Grid> - </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 ElementName=toggleEdit,Path=IsChecked}" Value="True"> - <Setter Property="Margin" Value="0 5 20 0"></Setter> - </DataTrigger> - </Style.Triggers> - </Style> - </TextBlock.Style> - </TextBlock> - - <StackPanel Orientation="Horizontal"> - <StackPanel.Style> - <Style TargetType="StackPanel"> - <Setter Property="Visibility" Value="Collapsed"></Setter> - <Style.Triggers> - <MultiDataTrigger> - <MultiDataTrigger.Conditions> - <Condition Binding="{Binding ElementName=toggleEdit,Path=IsChecked,IsAsync=True}" Value="False" /> - <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked,IsAsync=True}" Value="True" /> - <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter},IsAsync=True}" Value="False" /> - </MultiDataTrigger.Conditions> - <Setter Property="Visibility" Value="Visible"></Setter> - </MultiDataTrigger> - </Style.Triggers> - </Style> - </StackPanel.Style> + </StackPanel.Style> - <!--<touch:TouchToggleIconButton Padding="15" Width="60" Height="60" CornerRadius="30" Icon="EyeOutline" CheckedIcon="EyeOffOutline" Foreground="{StaticResource TangoGrayBrush}" CheckedForeground="{StaticResource TangoGrayBrush}" IsChecked="{Binding BrushStops[0].IsTransparent,IsAsync=True}"></touch:TouchToggleIconButton>--> + <!--<touch:TouchToggleIconButton Padding="15" Width="60" Height="60" CornerRadius="30" Icon="EyeOutline" CheckedIcon="EyeOffOutline" Foreground="{StaticResource TangoGrayBrush}" CheckedForeground="{StaticResource TangoGrayBrush}" IsChecked="{Binding BrushStops[0].IsTransparent}"></touch:TouchToggleIconButton>--> - <touch:TouchImageButton Visibility="{Binding BrushStops[0].ColorSpace,Converter={StaticResource ColorSpaceToVisibilityConverter},IsAsync=True}" 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> - </StackPanel> + <touch:TouchImageButton Visibility="{Binding BrushStops[0].ColorSpace,Converter={StaticResource ColorSpaceToVisibilityConverter}}" 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> + </StackPanel> - <StackPanel Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}" Orientation="Horizontal"> + <StackPanel Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" 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> - </StackPanel> - </StackPanel> + <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> + </Grid> + </DockPanel> </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}}" Value="True"></Condition> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" 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> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">ADD COLOR</TextBlock> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0">ADD COLOR</TextBlock> + </StackPanel> + </touch:TouchButton> </StackPanel> - </touch:TouchButton> - </StackPanel> + </Border> + </Grid> </Border> - </Grid> - </Border> - </touch:TouchVirtualizedContentControl> + </DataTemplate> + </touch:TouchVirtualizedContentReplaceControl.Content> + </touch:TouchVirtualizedContentReplaceControl> </DataTemplate> </UserControl.Resources> @@ -485,11 +466,6 @@ <touch:TouchLoadingPanel Grid.Row="1" IsLoading="{Binding IsBusy}"> <Grid> - - <Grid.CacheMode> - <BitmapCache RenderAtScale="1" SnapsToDevicePixels="False" /> - </Grid.CacheMode> - <Grid.RowDefinitions> <RowDefinition Height="1*"/> <RowDefinition Height="Auto"/> @@ -507,8 +483,7 @@ <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"> - <Run Text="{Binding Job.Rml.Name}"></Run><Run>,</Run> - <Run Text="{Binding Job.ColorSpace.Name}"></Run> + <Run Text="{Binding Job.Rml.Name}"></Run> </TextBlock> </StackPanel> </touch:TouchExpander.Header> @@ -727,7 +702,11 @@ <StackPanel Style="{StaticResource Level2ContainerExtraMargin}"> <Grid> - <localControls:JobSummeryViewer DataContext="{Binding Job,IsAsync=True}" Height="40"/> + <touch:TouchVirtualizedContentReplaceControl MinHeight="40"> + <DataTemplate> + <localControls:JobSummeryViewer Job="{Binding Job}" Height="40" DisplayMarkers="False" /> + </DataTemplate> + </touch:TouchVirtualizedContentReplaceControl> </Grid> <DockPanel Margin="0 30 0 0" LastChildFill="False"> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index 1f2895f26..b3fcd1208 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -58,14 +58,23 @@ namespace Tango.PPC.UI.Printing #else try { + _notificationProvider.SetGlobalBusyMessage("Processing job..."); handler = await _machineProvider.MachineOperator.Print(job); + _notificationProvider.ReleaseGlobalBusyMessage(); } catch (InsufficientLiquidQuantityException ex) { + _notificationProvider.ReleaseGlobalBusyMessage(); LogManager.Log(ex); await _notificationProvider.ShowDialog(new InsufficientLiquidQuantityViewVM(ex)); throw ex; } + catch (Exception ex) + { + _notificationProvider.ReleaseGlobalBusyMessage(); + LogManager.Log(ex); + throw ex; + } #endif handler.Completed += async (x, e) => |
