diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-08-25 10:08:01 +0300 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-08-25 10:08:01 +0300 |
| commit | 338edba081dba2a2aefb634811be1cc84ec93d64 (patch) | |
| tree | 0021538796c254a8eab8527e8461a2e831e68c1c /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml | |
| parent | 49ddda1cc22d6cbb72f499b37e5db32c95252dfa (diff) | |
| download | Tango-338edba081dba2a2aefb634811be1cc84ec93d64.tar.gz Tango-338edba081dba2a2aefb634811be1cc84ec93d64.zip | |
merge
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml | 143 |
1 files changed, 120 insertions, 23 deletions
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 c8e216191..007712d87 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Resources/MaterialDesign.xaml @@ -772,16 +772,77 @@ <Setter Property="Background" Value="Transparent"/> <Setter Property="Template"> <Setter.Value> - <ControlTemplate TargetType="{x:Type ComboBox}" > + <ControlTemplate TargetType="{x:Type controls:SearchComboBox}"> <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}"/> + <ToggleButton x:Name="SearchToggleButton" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" IsChecked="{Binding IsOpened, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Style="{x:Null}"> + <ToggleButton.Template> + <ControlTemplate TargetType="ToggleButton"> + <Grid> + <Border x:Name="ToggleTemplateRoot" + Background="{TemplateBinding Background}" + BorderBrush="{TemplateBinding BorderBrush}" + BorderThickness="{TemplateBinding BorderThickness}"> + <Border x:Name="splitBorder" + Margin="0" + HorizontalAlignment="Right" + VerticalAlignment="Center" + BorderBrush="Transparent" + BorderThickness="0"> + <Path x:Name="arrow" + Width="8" Height="8" + Margin="0" + Stretch="Uniform" + HorizontalAlignment="Right" + VerticalAlignment="Center" + Data="M7,10L12,15L17,10H7Z" + Fill="{TemplateBinding BorderBrush}" /> + </Border> + </Border> + </Grid> + <ControlTemplate.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" /> + <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false" /> + </MultiDataTrigger.Conditions> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" /> + <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" /> + </MultiDataTrigger.Conditions> + <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}" /> + </MultiDataTrigger> + <Trigger Property="IsPressed" Value="true"> + <Setter TargetName="arrow" Property="Fill" Value="{DynamicResource PrimaryHueDarkBrush}" /> + </Trigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter TargetName="arrow" Property="Fill" Value="{DynamicResource MaterialDesignCheckBoxDisabled}" /> + </Trigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" /> + <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false" /> + </MultiDataTrigger.Conditions> + <Setter TargetName="ToggleTemplateRoot" Property="BorderBrush" Value="Transparent"/> + </MultiDataTrigger> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" /> + <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" /> + </MultiDataTrigger.Conditions> + <Setter TargetName="ToggleTemplateRoot" Property="BorderBrush" Value="Transparent"/> + <Setter TargetName="splitBorder" Property="BorderBrush" Value="{DynamicResource MaterialDesignCheckBoxDisabled}" /> + </MultiDataTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </ToggleButton.Template> + </ToggleButton> <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" /> @@ -798,35 +859,25 @@ </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}}"/> + <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}"> + <materialDesign:ComboBoxPopup x:Name="PART_Popup" AllowsTransparency="true" HorizontalOffset="0" Tag="{Binding RelativeSource={RelativeSource AncestorType=controls:SearchComboBox}}" IsOpen="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=IsOpened, Mode=TwoWay}" PlacementTarget="{Binding ElementName=templateRoot}" SnapsToDevicePixels="True" UseLayoutRounding="True" Placement="Bottom" PopupAnimation="Fade" VerticalOffset="-10" DefaultVerticalOffset="5" + MinWidth="{Binding ElementName=SearchToggleButton,Path=ActualWidth}" DownVerticalOffset="{Binding ElementName=templateRoot, Path=ActualHeight}" UpVerticalOffset="15" ClassicMode="{Binding Path=(materialDesign:ComboBoxAssist.ClassicMode), RelativeSource={RelativeSource TemplatedParent}}" + MaxHeight="{TemplateBinding MaxDropDownHeight}" UpContentTemplate="{StaticResource PopupContentUpTemplate}" DownContentTemplate="{StaticResource TransparentPopupContentDownTemplate}" ClassicContentTemplate="{StaticResource PopupContentClassicTemplate}" StaysOpen="False" Margin="10 0 0 0"> <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"> + <DockPanel> + <TextBox x:Name="Search" DockPanel.Dock="Top" Margin="10" Padding="0 5" HorizontalAlignment="Stretch" Text="{Binding RelativeSource={RelativeSource AncestorType=controls:SearchComboBox}, Path=SearchFilter, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Background="{DynamicResource ComboBox.Floating.Background}" IsReadOnly="False" FontSize="14" TextAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center" BorderThickness="0 0 0 2" > <TextBox.Style> <Style TargetType="TextBox"/> </TextBox.Style> </TextBox> - <ScrollViewer Grid.Row="1" Background="{DynamicResource ComboBox.Floating.Background}" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden"> + <ListBox x:Name="list" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=controls:SearchComboBox}, Path = ListItemsSource}" ItemTemplate="{TemplateBinding ItemTemplate}"/> - <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained"/> - - </ScrollViewer> - </Grid> + </DockPanel> </Border> </ContentControl> - </controls:PopupWithKeyboardFocus> + </materialDesign:ComboBoxPopup> </Grid> </Grid> <ControlTemplate.Triggers> @@ -926,6 +977,52 @@ </Setter> </Style> + <Style x:Key="CheckBoxListBoxItem" TargetType="{x:Type ListBoxItem}"> + <Setter Property="SnapsToDevicePixels" Value="true" /> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="ListBoxItem"> + <CheckBox Margin="5,2" IsChecked="{TemplateBinding IsSelected}" x:Name="CheckBoxItem" + Command="{Binding RelativeSource={RelativeSource AncestorType=controls:AllSelectedCheckboxList}, Path=ClickCheckBoxCommand}" CommandParameter="{Binding RelativeSource={RelativeSource TemplatedParent}}"> + <ContentPresenter /> + </CheckBox> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style x:Key="AllSelectedCheckBoxListStyle" TargetType="{x:Type controls:AllSelectedCheckboxList}" BasedOn="{StaticResource MaterialDesignListBox}"> + <!--<Setter Property="OverridesDefaultStyle" Value="true" />--> + <Setter Property="SnapsToDevicePixels" Value="true" /> + <Setter Property="SelectionMode" Value="Multiple"/> + <Setter Property="ItemContainerStyle" Value="{StaticResource CheckBoxListBoxItem}"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type controls:AllSelectedCheckboxList}"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true"> + <DockPanel> + <CheckBox x:Name="SelectAllCheckBox" DockPanel.Dock="Top" VerticalAlignment="Center" IsChecked="{Binding AllSelected, Mode=TwoWay,RelativeSource={RelativeSource AncestorType=controls:AllSelectedCheckboxList}}" Margin="5"> + <TextBlock Margin="5 0 0 0" VerticalAlignment="Center" Text="SelectAll"></TextBlock> + </CheckBox> + <ScrollViewer DockPanel.Dock="Bottom" Focusable="false" Padding="{TemplateBinding Padding}"> + <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> + </ScrollViewer> + </DockPanel> + </Border> + <ControlTemplate.Triggers> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsGrouping" Value="true"/> + <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="ScrollViewer.CanContentScroll" Value="false"/> + </MultiTrigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + <Style TargetType="Window"> <Setter Property="FontFamily" Value="{StaticResource flexo}"></Setter> </Style> |
