diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2021-11-01 14:53:16 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2021-11-01 14:53:16 +0200 |
| commit | 20f49c625cd32b95154db138ed7eeebbadd04bf7 (patch) | |
| tree | 951627b53972a48e77f9c3d11e9de5295e15fa45 /Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml | |
| parent | b1049c0822b76939215225a617e143274abe2e8b (diff) | |
| download | Tango-20f49c625cd32b95154db138ed7eeebbadd04bf7.tar.gz Tango-20f49c625cd32b95154db138ed7eeebbadd04bf7.zip | |
Color selection and Job sequence package. Redesign list control, move Color Selection View to dialogs, implement save.
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml new file mode 100644 index 000000000..f50e04742 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml @@ -0,0 +1,98 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:controls="clr-namespace:Tango.Touch.Controls" + xmlns:local="clr-namespace:Tango.Touch.Styles"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Resources/Colors.xaml" /> + <ResourceDictionary Source="../Resources/Fonts.xaml" /> + <ResourceDictionary Source="../Styles/TouchButton.xaml" /> + <ResourceDictionary Source="../Styles/TouchIconButton.xaml" /> + + <ResourceDictionary> + <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" /> + <converters:NullObjectToBooleanConverter x:Key="NullObjectToBooleanConverter" /> + </ResourceDictionary> + </ResourceDictionary.MergedDictionaries> + + <SolidColorBrush x:Key="TransparentBrush" Color="Transparent" /> + + <Style x:Key="TouchNumericMiddleUpDownControl" TargetType="{x:Type controls:TouchNumericUpDownConrol}"> + <Setter Property="Background" Value="{StaticResource TangoNotificationBarMaskBrush}"/> + <Setter Property="Height" Value="32"/> + <Setter Property="BorderBrush" Value="Transparent"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="controls:TouchNumericUpDownConrol"> + <StackPanel Orientation="Horizontal"> + <StackPanel.Resources> + <Style x:Key="emptyButton" TargetType="RepeatButton" > + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Focusable" Value="False"></Setter> + <Setter Property="Foreground" Value="{StaticResource TangoMidAccentBrush}" /> + <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="RepeatButton"> + <Border Margin="{TemplateBinding Padding}" Background="{TemplateBinding Background}"> + <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" /> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + <Style.Triggers> + <Trigger Property="RepeatButton.IsPressed" Value="True"> + <Setter Property="Background" Value="Transparent" /> + <Setter Property="Foreground" Value="{StaticResource TangoKeyboardKeyLightBrush}" /> + </Trigger> + <EventTrigger RoutedEvent="RepeatButton.TouchDown"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"></DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TangoKeyboardKeyLightTextBrush}"></DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + <EventTrigger RoutedEvent="RepeatButton.TouchLeave"> + <EventTrigger.Actions> + <BeginStoryboard> + <Storyboard> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TransparentBrush}"></DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground"> + <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TangoKeyboardKeyDarkTextBrush}"></DiscreteObjectKeyFrame> + </ObjectAnimationUsingKeyFrames> + </Storyboard> + </BeginStoryboard> + </EventTrigger.Actions> + </EventTrigger> + </Style.Triggers> + </Style> + </StackPanel.Resources> + <RepeatButton Background="Transparent" Padding="2" Style="{StaticResource emptyButton}" Command="{Binding Path=DecrementCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" VerticalAlignment="Center"> + <controls:TouchIcon Icon="Minus" Width="16" Height="3" VerticalAlignment="Center"/> + </RepeatButton> + + <controls:TouchNumericTextBox x:Name="Number_PART" Margin="16 4 0 0" FontSize="20" HorizontalContentAlignment="Center" VerticalAlignment="Center" BorderBrush="{TemplateBinding BorderBrush}" VerticalContentAlignment="Center" UpdateBindingOnlyWhenFocused="True" + Value="{Binding Value,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" Minimum="{Binding MinValue,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}}" Maximum="{Binding MaxValue,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}"/> + + + <RepeatButton Background="Transparent" Margin="16 0 0 0" Padding="4" Style="{StaticResource emptyButton}" Command="{Binding Path=IncrementCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" VerticalAlignment="Center"> + <controls:TouchIcon Icon="Plus" Width="16" VerticalAlignment="Center"/> + </RepeatButton> + + </StackPanel> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file |
