Skip to content

Commit

Permalink
Added outline style for MahApp NumericUpDown and added to demo. fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
stigrune committed Oct 12, 2021
1 parent e160e5d commit c603146
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions MahMaterialDragablzMashUp/Mah.xaml
Expand Up @@ -66,6 +66,9 @@
<smtx:XamlDisplay UniqueKey="NumericUpDown_2">
<controls:NumericUpDown Culture="ar-EG" FlowDirection="RightToLeft" Margin="5" controls:TextBoxHelper.SelectAllOnFocus="True"/>
</smtx:XamlDisplay>
<smtx:XamlDisplay UniqueKey="NumericUpDown_3">
<controls:NumericUpDown Style="{StaticResource MaterialDesignOutlinedNumericUpDown}"/>
</smtx:XamlDisplay>
</StackPanel>
</TabItem>
<TabItem Header="DataGrid">
Expand Down
Expand Up @@ -257,6 +257,15 @@
<Setter TargetName="PART_NumericDown" Property="Visibility" Value="Collapsed" />
<Setter TargetName="PART_NumericUp" Property="Visibility" Value="Collapsed" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsKeyboardFocusWithin" Value="True" />
<Condition Property="mah:ControlsHelper.FocusBorderThickness" Value="1" />
<Condition Property="mah:ControlsHelper.CornerRadius" Value="4" />
</MultiTrigger.Conditions>
<Setter TargetName="Base" Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mah:ControlsHelper.FocusBorderThickness)}" />
<Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mah:ControlsHelper.MouseOverBorderBrush)}" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
Expand All @@ -265,4 +274,13 @@
<Setter Property="UpDownButtonsWidth" Value="22" />
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}" />
</Style>

<Style TargetType="{x:Type mah:NumericUpDown}" x:Key="MaterialDesignOutlinedNumericUpDown" BasedOn="{StaticResource MaterialDesignNumericUpDown}">
<Setter Property="mah:ControlsHelper.CornerRadius" Value="4" />
<Setter Property="mah:ControlsHelper.FocusBorderThickness" Value="1" />
<Setter Property="Padding" Value="16" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
</Style>

</ResourceDictionary>

0 comments on commit c603146

Please sign in to comment.