aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2020-08-18 16:50:48 +0300
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2020-08-18 16:50:48 +0300
commit4702a085323fc2a6b403187867f9bf8c66bf45f6 (patch)
tree456576c6538db6ad5aecef164515b17b60b6bb9f /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views
parent1ed6a2ad1d92c1d21ab5cf9f87db71dcc043e2dc (diff)
downloadTango-4702a085323fc2a6b403187867f9bf8c66bf45f6.tar.gz
Tango-4702a085323fc2a6b403187867f9bf8c66bf45f6.zip
Rafactoring List items HeadCleaning in Statistics view
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml44
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml.cs17
2 files changed, 37 insertions, 24 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml
index 9e4a9603e..bd46a0ed7 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml
@@ -15,6 +15,7 @@
xmlns:enumerations="clr-namespace:Tango.BL.Enumerations;assembly=Tango.BL"
xmlns:local="clr-namespace:Tango.MachineStudio.Statistics.Views"
xmlns:model="clr-namespace:Tango.MachineStudio.Statistics.Models"
+ xmlns:vs="clr-namespace:Tango.MachineStudio.Statistics.ViewModels"
xmlns:wellknowntypes="clr-namespace:Google.Protobuf.WellKnownTypes;assembly=Google.Protobuf"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="1800" Foreground="{StaticResource JobFieldForeground}">
@@ -33,7 +34,6 @@
<localConverters:NanoLiterToLiterFormatConverter x:Key="NanoLiterToLiterFormatConverter"/>
<localConverters:LiquidQuantityToFormatStringConverter x:Key="LiquidQuantityToFormatStringConverter"/>
<localConverters:TooltipLiquidQuantityFormatConverter x:Key="TooltipLiquidQuantityFormatConverter"/>
- <localConverters:HeadCleaningConverter x:Key="HeadCleaningConverter"/>
<ResourceDictionary x:Key="SelectAllTextBoxResource">
<Style TargetType="TextBox">
@@ -42,6 +42,12 @@
</Style>
</ResourceDictionary>
+ <ObjectDataProvider x:Key="HeadCleaning" MethodName="GetValues" ObjectType="{x:Type sys:Enum}">
+ <ObjectDataProvider.MethodParameters>
+ <x:Type TypeName="vs:HeadCleaningSelectionEnum"/>
+ </ObjectDataProvider.MethodParameters>
+ </ObjectDataProvider>
+
<Style TargetType="{x:Type TextBlock}" x:Key="WrapText">
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
@@ -88,15 +94,6 @@
</CheckBox>
</DataTemplate>
- <DataTemplate x:Key="PopupIsHeadHeatingDataTemplate">
- <CheckBox VerticalAlignment="Center" FontSize="11" DockPanel.Dock="Left" IsChecked="{Binding IsSelected}">
- <CheckBox.Content>
- <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding Data, Converter={StaticResource HeadCleaningConverter}}"/>
- </CheckBox.Content>
- </CheckBox>
- </DataTemplate>
-
-
<Style x:Key="{x:Type ToolTip}" TargetType="{x:Type ToolTip}" BasedOn="{StaticResource MaterialDesignToolTip}">
<Setter Property="Background" Value="{StaticResource Logging.Background}" />
<Setter Property="Foreground" Value="{StaticResource MainWindow.Foreground}" />
@@ -364,18 +361,8 @@
<Button x:Name="IsHeadCleaningButton" Width="18" Padding="0" Height="16" DockPanel.Dock="Right" BorderBrush="{x:Null}" HorizontalAlignment="Left" Click="IsHeadCleaningButton_Click" Style="{StaticResource MaterialDesignFlatButton}" Foreground="{StaticResource MainWindow.Foreground}">
<materialDesign:PackIcon Width="16" Height="16" Kind="ChevronDown" VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}" HorizontalAlignment="Right"/>
</Button>
- <TextBlock VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}" FontSize="11" Margin="5 0 2 0">
- <TextBlock.Style>
- <Style TargetType="{x:Type TextBlock}">
- <Setter Property="Text" Value="{Binding IsHeadCleaningSelection.SynchedSource, Converter={StaticResource CollectionConverter}, ConverterParameter='Exclude, Only'}">
- </Setter>
- <Style.Triggers>
- <DataTrigger Binding="{Binding IsHeadCleaningSelection.SynchedSource.Count}" Value="2">
- <Setter Property="Text" Value="Include"/>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </TextBlock.Style>
+ <TextBlock VerticalAlignment="Center" Foreground="{StaticResource MainWindow.Foreground}" FontSize="11" Margin="5 0 2 0" Text="{Binding HeadCleaningSelected, Converter={StaticResource EnumToDescriptionConverter}}">
+
</TextBlock>
</DockPanel>
</Border>
@@ -384,8 +371,17 @@
<Border.Effect>
<DropShadowEffect Opacity="0.2" />
</Border.Effect>
- <ItemsControl ItemsSource="{Binding IsHeadCleaningSelection}" Foreground="{StaticResource MainWindow.Foreground}" ItemTemplate="{StaticResource PopupIsHeadHeatingDataTemplate}"/>
-
+ <ListBox x:Name="HeadCleaningListBoxItem" ItemsSource="{Binding Source={StaticResource HeadCleaning}}" Foreground="{StaticResource MainWindow.Foreground}" SelectedItem="{Binding HeadCleaningSelected, Mode=TwoWay}" SelectionMode="Single" >
+ <ListBox.ItemTemplate>
+ <DataTemplate>
+ <CheckBox x:Name="HeadCleaningCheckBox" Selector.IsSelected="True" VerticalAlignment="Center" FontSize="11" DockPanel.Dock="Left" IsChecked="{Binding IsSelected, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, UpdateSourceTrigger=PropertyChanged}" Click="CheckBox_PreventUndoCheck">
+ <CheckBox.Content>
+ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="{Binding Converter={StaticResource EnumToDescriptionConverter}}"/>
+ </CheckBox.Content>
+ </CheckBox>
+ </DataTemplate>
+ </ListBox.ItemTemplate>
+ </ListBox>
</Border>
</Popup>
</Grid>
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml.cs
index 9bfed23e3..226478a7d 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Statistics/Views/JobRunsView.xaml.cs
@@ -28,6 +28,8 @@ namespace Tango.MachineStudio.Statistics.Views
InitializeComponent();
_lastSelectedGridItemIndex = -1;
}
+
+
private void Button_Click(object sender, RoutedEventArgs e)
{
selectMachineButton.IsChecked = true;
@@ -127,5 +129,20 @@ namespace Tango.MachineStudio.Statistics.Views
}
}
}
+
+ private void CheckBox_PreventUndoCheck(object sender, RoutedEventArgs e)
+ {
+ if( sender is CheckBox)
+ {
+ CheckBox cb = sender as CheckBox;
+ if (cb.IsChecked == false)
+ {
+ cb.IsChecked = true;
+ e.Handled = true;
+ return;
+ }
+ }
+ e.Handled = false;
+ }
}
}