aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-23 00:24:11 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-12-23 00:24:11 +0200
commit518c9192e4445d82f192edcccb2ffb64ffc88a65 (patch)
treebbf30297b0e452066801aefd9c9f2916020e57a6 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs
parent7b6ec0a4e66a4402d5ee0beb4b34b18604e28cd8 (diff)
downloadTango-518c9192e4445d82f192edcccb2ffb64ffc88a65.tar.gz
Tango-518c9192e4445d82f192edcccb2ffb64ffc88a65.zip
ColorSpace per stop implemented on PPC.
Synchronization only when values change. Volume open for all. RGB to closest catalog item...
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs161
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs10
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml83
3 files changed, 118 insertions, 136 deletions
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..e8af7c957 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) =>
{
@@ -471,33 +448,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 +501,8 @@ namespace Tango.PPC.Jobs.ViewModels
ValidateBrushStops();
+ CoerceBrushStopsColorSpaceChange();
+
DyeCommand.RaiseCanExecuteChanged();
StartSampleDyeCommand.RaiseCanExecuteChanged();
StartFineTuningCommand.RaiseCanExecuteChanged();
@@ -718,7 +681,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 +702,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 +776,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 +806,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 +832,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 +968,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 +1030,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 +1301,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 64931cbe3..23e381206 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/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
index 6a94034db..467c3f72b 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
@@ -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">
@@ -149,32 +150,21 @@
</Setter.Value>
</Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="RGB">
+ <DataTrigger Binding="{Binding 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">
+ <DataTrigger Binding="{Binding 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">
+ <DataTrigger Binding="{Binding 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">
+ <DataTrigger Binding="{Binding 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">
+ <DataTrigger Binding="{Binding ColorSpace.Name,IsAsync=True}" 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>
@@ -215,9 +205,6 @@
<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" />
@@ -303,8 +290,12 @@
</StackPanel>
<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">
+ <StackPanel Margin="0 5 0 0" HorizontalAlignment="Left" Width="300" Visibility="{Binding ElementName=toggle_large_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter},IsAsync=True}">
+ <DockPanel LastChildFill="False" Margin="0 0 0 0">
+ <TextBlock Text="Color space:" VerticalAlignment="Bottom"></TextBlock>
+ <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>
@@ -330,32 +321,21 @@
</Setter.Value>
</Setter>
<Style.Triggers>
- <DataTrigger Binding="{Binding ElementName=view,Path=DataContext.Job.ColorSpace.Name,IsAsync=True}" Value="RGB">
+ <DataTrigger Binding="{Binding 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">
+ <DataTrigger Binding="{Binding 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">
+ <DataTrigger Binding="{Binding 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">
+ <DataTrigger Binding="{Binding 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">
+ <DataTrigger Binding="{Binding ColorSpace.Name,IsAsync=True}" 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>
@@ -380,7 +360,7 @@
</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">
+ <DockPanel LastChildFill="False" Margin="0 0 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>
@@ -507,8 +487,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>