diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-08-05 13:39:17 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-08-05 13:39:17 +0300 |
| commit | 649f1c03e08072bfe1c73adfbf377bcad58b4ec0 (patch) | |
| tree | e04d3d6db342e2499e7eaf2f10a2baea3c671f67 /Software/Visual_Studio/MachineStudio | |
| parent | a28eb2177c88edaa5097748de4dbd6f0133a0e7a (diff) | |
| parent | 592cf6ec8f64037215a8cdf50f41437698a13e81 (diff) | |
| download | Tango-649f1c03e08072bfe1c73adfbf377bcad58b4ec0.tar.gz Tango-649f1c03e08072bfe1c73adfbf377bcad58b4ec0.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/MachineStudio')
4 files changed, 172 insertions, 19 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 35c621822..5b29fd432 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -756,7 +756,7 @@ <StackPanel> <TextBlock>MEDIA</TextBlock> <StackPanel Orientation="Horizontal" DockPanel.Dock="Left"> - <ComboBox Width="250" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" Style="{StaticResource TransparentComboBoxStyle}" HorizontalContentAlignment="Stretch"> + <controls:SearchComboBox Width="250" ItemsSource="{Binding Rmls}" SelectedItem="{Binding SelectedRML}" HorizontalContentAlignment="Stretch" SearchParam="Name"> <ComboBox.ItemTemplate> <DataTemplate> <DockPanel> @@ -771,7 +771,7 @@ </DockPanel> </DataTemplate> </ComboBox.ItemTemplate> - </ComboBox> + </controls:SearchComboBox> <!--<Button Margin="20 30 0 0" Command="{Binding EditRMLCommand}" HorizontalAlignment="Right" Style="{StaticResource MaterialDesignFlatButton}"> <StackPanel Orientation="Horizontal"> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorCalibrationViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorCalibrationViewVM.cs index 7d05897d5..7d913299e 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorCalibrationViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/ColorCalibrationViewVM.cs @@ -346,7 +346,7 @@ namespace Tango.MachineStudio.RML.ViewModels if(!String.IsNullOrEmpty(result.ErrorMessage)) { - LogManager.Log(result.ErrorMessage, "Error occurred while trying to call GetLinearizationMeasurements."); + //LogManager.Log(result.ErrorMessage, "Error occurred while trying to call GetLinearizationMeasurements."); } return result.InkPercentage.ToList(); } diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs index c31c95800..229d62df7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.RML/ViewModels/MainViewVM.cs @@ -34,7 +34,6 @@ namespace Tango.MachineStudio.RML.ViewModels private IAuthenticationProvider _authentication; private IActionLogManager _actionLogManager; private RmlDTO _rmlBeforeSave; - private static object _syncLock = new object(); private ObservablesContext _rmls_context; private ObservablesContext _active_context; @@ -56,8 +55,6 @@ namespace Tango.MachineStudio.RML.ViewModels set { _rmlssCollectionView = value; - BindingOperations.EnableCollectionSynchronization(_rmlssCollectionView, _syncLock); - RaisePropertyChangedAuto(); } } @@ -311,6 +308,15 @@ namespace Tango.MachineStudio.RML.ViewModels } RmlsCollectionView = CollectionViewSource.GetDefaultView(Rmls); RmlsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Rml.LastUpdated), ListSortDirection.Descending)); + //RmlsCollectionView.Filter = new Predicate<object>(FilterCollection); + + RmlsCollectionView.Filter = (rml) => + { + Rml r = rml as Rml; + return String.IsNullOrWhiteSpace(RMLFilter) + || r.Name.ToLower().Contains(RMLFilter.ToLower()) //Rml name + || (r.MediaMaterial != null && r.MediaMaterial.Name.ToLower().Contains(RMLFilter.ToLower())); + }; } private async void LoadActiveRML(String guid) @@ -683,19 +689,7 @@ namespace Tango.MachineStudio.RML.ViewModels private void OnRMLFilterChanged() { - String filter = RMLFilter.ToLower(); - - RmlsCollectionView.Filter = (rml) => - { - Rml r = rml as Rml; - return String.IsNullOrWhiteSpace(filter) - || - r.Name.ToLower().Contains(filter) //Rml name - || - (r.MediaMaterial != null && r.MediaMaterial.Name.ToLower().Contains(filter)) // Material name - || - (r.Cct != null && r.Cct.FileName != null && r.Cct.FileName.ToString().Contains(filter)); //Cct.FileName - }; + RmlsCollectionView.Refresh(); } private void RemoveLiquidFactor(LiquidTypesRml liquidFactor) diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml index 222eecb71..c8e216191 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -4,6 +4,7 @@ xmlns:editors="clr-namespace:Tango.AutoComplete.Editors;assembly=Tango.AutoComplete" xmlns:dragAndDrop="clr-namespace:Tango.DragAndDrop;assembly=Tango.DragAndDrop" xmlns:sharedConverters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:local="clr-namespace:Tango.MachineStudio.Common.Resources" @@ -767,6 +768,164 @@ </Setter> </Style> + <Style TargetType="{x:Type controls:SearchComboBox}" BasedOn="{StaticResource MaterialDesignComboBox}"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ComboBox}" > + <Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True"> + <Grid x:Name="InnerRoot"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" /> + </Grid.ColumnDefinitions> + <ToggleButton x:Name="SearchToggleButton" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" + Style="{StaticResource MaterialDesignComboBoxToggleButton}"/> + <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" UseLayoutRounding="{TemplateBinding UseLayoutRounding}"> + <Grid x:Name="InputRoot" HorizontalAlignment="Left"> + <ContentPresenter x:Name="contentPresenter" Content="{TemplateBinding SelectionBoxItem}" ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" IsHitTestVisible="False" /> + <TextBox x:Name="PART_EditableTextBox" IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch" Style="{StaticResource MaterialDesignComboBoxEditableTextBox}" CaretBrush="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderBrush}" Visibility="Collapsed" /> + + <materialDesign:SmartHint x:Name="Hint" + HintProxy="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}" + FontSize="{TemplateBinding FontSize}" + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" + UseLayoutRounding="{TemplateBinding UseLayoutRounding}" + UseFloating="{Binding Path=(materialDesign:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}" + HintOpacity="{Binding Path=(materialDesign:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}" + Hint="{TemplateBinding materialDesign:HintAssist.Hint}" /> + </Grid> + </Grid> + <Line x:Name="DashedLine" Grid.ColumnSpan="2" VerticalAlignment="Bottom" Visibility="{Binding Path=IsEnabled, RelativeSource={RelativeSource Self}, Converter={StaticResource InverseBoolToVisConverter}}" StrokeThickness="1.25" StrokeDashArray="1,2.5" StrokeDashCap="Round" X1="0" X2="{Binding ActualWidth, ElementName=SearchToggleButton}" Y1="0" Y2="0" Stroke="{TemplateBinding BorderBrush}" Opacity="0.56" /> + <materialDesign:Underline x:Name="Underline" Grid.ColumnSpan="2" IsActive="{Binding ElementName=PART_EditableTextBox, Path=IsKeyboardFocused}" + Visibility="{Binding Path=(materialDesign:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"/> + + <controls:PopupWithKeyboardFocus x:Name="PART_Popup" AllowsTransparency="true" Focusable="False" HorizontalOffset="-11.5" + Tag="{Binding RelativeSource={RelativeSource AncestorType=controls:SearchComboBox}}" IsOpen="{Binding ElementName=SearchToggleButton,Path=IsChecked}" PlacementTarget="{Binding ElementName=templateRoot}" + SnapsToDevicePixels="True" UseLayoutRounding="True" Placement="Custom" PopupAnimation="Fade" VerticalOffset="-10" DefaultVerticalOffset="5" + DownVerticalOffset="{Binding ElementName=templateRoot, Path=ActualHeight}" UpVerticalOffset="15" ClassicMode="{Binding Path=(materialDesign:ComboBoxAssist.ClassicMode), RelativeSource={RelativeSource TemplatedParent}}" + UpContentTemplate="{StaticResource PopupContentUpTemplate}" DownContentTemplate="{StaticResource TransparentPopupContentDownTemplate}" ClassicContentTemplate="{StaticResource PopupContentClassicTemplate}"> + <ContentControl> + <Border Opacity="1" Background="{DynamicResource ComboBox.Floating.Background}" Padding="1" BorderThickness="0" BorderBrush="{TemplateBinding BorderBrush}" MaxHeight="{TemplateBinding MaxDropDownHeight}" > + <Grid > + <Grid.RowDefinitions> + <RowDefinition Height="30"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + <TextBox x:Name="Search" Grid.Row="0" HorizontalAlignment="Stretch" Text="{Binding RelativeSource={RelativeSource AncestorType=controls:SearchComboBox}, Path=SearchText}" Background="{DynamicResource ComboBox.Floating.Background}" IsReadOnly="False" FontSize="14" TextAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0 0 0 2" Margin=" 1 0 1 0"> + <TextBox.Style> + <Style TargetType="TextBox"/> + </TextBox.Style> + </TextBox> + <ScrollViewer Grid.Row="1" Background="{DynamicResource ComboBox.Floating.Background}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden"> + + <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained"/> + + </ScrollViewer> + </Grid> + </Border> + </ContentControl> + </controls:PopupWithKeyboardFocus> + </Grid> + </Grid> + <ControlTemplate.Triggers> + <Trigger SourceName="PART_Popup" Property="PopupPlacement" Value="{x:Static materialDesign:ComboBoxPopupPlacement.Classic}"> + <Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignComboBoxItemStyle}" /> + </Trigger> + <Trigger SourceName="PART_Popup" Property="IsOpen" Value="True"> + <Setter Property="Background" TargetName="templateRoot" Value="Transparent" /> + </Trigger> + <Trigger Property="IsEnabled" Value="False"> + <Setter TargetName="templateRoot" Property="Opacity" Value="0.56"/> + <Setter TargetName="SearchToggleButton" Property="BorderBrush" Value="Transparent"/> + </Trigger> + <Trigger Property="IsEditable" Value="True"> + <Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" /> + <Setter TargetName="Underline" Property="Visibility" Value="{Binding Path=(materialDesign:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}" /> + <Setter TargetName="contentPresenter" Property="Visibility" Value="Collapsed" /> + </Trigger> + <Trigger Property="materialDesign:HintAssist.IsFloating" Value="True"> + <Setter TargetName="InnerRoot" Property="Margin" Value="0 11.5 0 0" /> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsEditable" Value="False"/> + <Condition Property="IsDropDownOpen" Value="True"/> + </MultiTrigger.Conditions> + <Setter TargetName="Underline" Property="Visibility" Value="Hidden"/> + <Setter TargetName="SearchToggleButton" Property="BorderBrush" Value="Transparent"/> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition SourceName="Hint" Property="IsContentNullOrEmpty" Value="False" /> + <Condition Property="materialDesign:HintAssist.IsFloating" Value="True" /> + <Condition Property="IsKeyboardFocusWithin" Value="True" /> + </MultiTrigger.Conditions> + <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" /> + <Setter TargetName="Hint" Property="HintOpacity" Value="1" /> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="materialDesign:HintAssist.IsFloating" Value="True" /> + <!--<Condition SourceName="Hint" Property="IsHintInFloatingPosition" Value="True" />--> + <Condition Property="IsKeyboardFocusWithin" Value="True" /> + </MultiTrigger.Conditions> + <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" /> + <Setter TargetName="Hint" Property="HintOpacity" Value="1" /> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition SourceName="Hint" Property="IsContentNullOrEmpty" Value="False" /> + <Condition SourceName="PART_EditableTextBox" Property="IsKeyboardFocused" Value="True" /> + </MultiTrigger.Conditions> + <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" /> + <Setter TargetName="Hint" Property="HintOpacity" Value="1" /> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition SourceName="Hint" Property="IsContentNullOrEmpty" Value="False" /> + <Condition Property="IsDropDownOpen" Value="True" /> + </MultiTrigger.Conditions> + <Setter TargetName="Hint" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" /> + <Setter TargetName="Hint" Property="HintOpacity" Value="1" /> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsGrouping" Value="true" /> + <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" /> + </MultiTrigger.Conditions> + <Setter Property="ScrollViewer.CanContentScroll" Value="false" /> + </MultiTrigger> + <Trigger Property="IsKeyboardFocused" Value="true"> + <Setter TargetName="Underline" Property="IsActive" Value="True"/> + </Trigger> + <Trigger Property="Validation.HasError" Value="true"> + <Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/> + <Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsMouseOver" Value="true" /> + <Condition Property="Validation.HasError" Value="true" /> + </MultiTrigger.Conditions> + <Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/> + <Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/> + </MultiTrigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsMouseOver" Value="true" /> + <Condition Property="Validation.HasError" Value="false" /> + </MultiTrigger.Conditions> + <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/> + <Setter TargetName="Underline" Property="Background" Value="{DynamicResource PrimaryHueMidBrush}"/> + </MultiTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style TargetType="Window"> <Setter Property="FontFamily" Value="{StaticResource flexo}"></Setter> </Style> |
