|
9 | 9 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Menu.xaml" />
|
10 | 10 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ToolTip.xaml" />
|
11 | 11 | </ResourceDictionary.MergedDictionaries>
|
12 |
| - |
| 12 | + |
| 13 | + <Style TargetType="{x:Type Button}" x:Key="MaterialDesignPopupBoxButton"> |
| 14 | + <Setter Property="VerticalContentAlignment" Value="Bottom" /> |
| 15 | + <Setter Property="HorizontalContentAlignment" Value="Left" /> |
| 16 | + <Setter Property="Padding" Value="16 0 16 16" /> |
| 17 | + <Setter Property="Foreground" Value="{DynamicResource MaterialDesignBody}" /> |
| 18 | + <Setter Property="Template"> |
| 19 | + <Setter.Value> |
| 20 | + <ControlTemplate TargetType="{x:Type Button}"> |
| 21 | + <Grid> |
| 22 | + <VisualStateManager.VisualStateGroups> |
| 23 | + <VisualStateGroup Name="CommonStates"> |
| 24 | + <VisualStateGroup.Transitions> |
| 25 | + <VisualTransition GeneratedDuration="0:0:0.3" To="Normal"> |
| 26 | + <VisualTransition.GeneratedEasingFunction> |
| 27 | + <CircleEase EasingMode="EaseOut"/> |
| 28 | + </VisualTransition.GeneratedEasingFunction> |
| 29 | + </VisualTransition> |
| 30 | + </VisualStateGroup.Transitions> |
| 31 | + <VisualState Name="Normal"/> |
| 32 | + <VisualState Name="MouseOver"> |
| 33 | + <Storyboard> |
| 34 | + <DoubleAnimation Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" To="0.1" Duration="0"/> |
| 35 | + </Storyboard> |
| 36 | + </VisualState> |
| 37 | + <VisualState Name="Disabled"> |
| 38 | + <Storyboard> |
| 39 | + <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.48" Duration="0"/> |
| 40 | + </Storyboard> |
| 41 | + </VisualState> |
| 42 | + </VisualStateGroup> |
| 43 | + </VisualStateManager.VisualStateGroups> |
| 44 | + <Border x:Name="MouseOverBorder" Opacity="0" Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}"/> |
| 45 | + <wpf:Ripple Feedback="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" |
| 46 | + Focusable="False" |
| 47 | + MinHeight="48" |
| 48 | + Content="{TemplateBinding Content}" |
| 49 | + ContentTemplate="{TemplateBinding ContentTemplate}" |
| 50 | + ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" |
| 51 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
| 52 | + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 53 | + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
| 54 | + Padding="{TemplateBinding Padding}"/> |
| 55 | + </Grid> |
| 56 | + </ControlTemplate> |
| 57 | + </Setter.Value> |
| 58 | + </Setter> |
| 59 | + </Style> |
| 60 | + |
13 | 61 | <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
14 | 62 | <converters:NullableToVisibilityConverter x:Key="NullVisibilityConverter" />
|
15 | 63 | <converters:NullableToVisibilityConverter x:Key="InvertedNullVisibilityConverter" NullValue="Visible" NotNullValue="Collapsed" />
|
|
69 | 117 | RenderOptions.ClearTypeHint="Enabled"
|
70 | 118 | Margin="5">
|
71 | 119 | <wpf:Card.Resources>
|
72 |
| - <Style TargetType="{x:Type Button}"> |
73 |
| - <Setter Property="VerticalContentAlignment" Value="Bottom" /> |
74 |
| - <Setter Property="HorizontalContentAlignment" Value="Left" /> |
75 |
| - <Setter Property="Padding" Value="16 0 16 16" /> |
76 |
| - <Setter Property="Foreground" Value="{DynamicResource MaterialDesignBody}" /> |
77 |
| - <Setter Property="Template"> |
78 |
| - <Setter.Value> |
79 |
| - <ControlTemplate TargetType="{x:Type Button}"> |
80 |
| - <Grid> |
81 |
| - <VisualStateManager.VisualStateGroups> |
82 |
| - <VisualStateGroup Name="CommonStates"> |
83 |
| - <VisualStateGroup.Transitions> |
84 |
| - <VisualTransition GeneratedDuration="0:0:0.3" To="Normal"> |
85 |
| - <VisualTransition.GeneratedEasingFunction> |
86 |
| - <CircleEase EasingMode="EaseOut"/> |
87 |
| - </VisualTransition.GeneratedEasingFunction> |
88 |
| - </VisualTransition> |
89 |
| - </VisualStateGroup.Transitions> |
90 |
| - <VisualState Name="Normal"/> |
91 |
| - <VisualState Name="MouseOver"> |
92 |
| - <Storyboard> |
93 |
| - <DoubleAnimation Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" |
94 |
| - To="0.1" Duration="0"/> |
95 |
| - </Storyboard> |
96 |
| - </VisualState> |
97 |
| - <VisualState Name="Disabled"> |
98 |
| - <Storyboard> |
99 |
| - <DoubleAnimation Storyboard.TargetProperty="Opacity" |
100 |
| - To="0.48" Duration="0"/> |
101 |
| - </Storyboard> |
102 |
| - </VisualState> |
103 |
| - </VisualStateGroup> |
104 |
| - </VisualStateManager.VisualStateGroups> |
105 |
| - <Border x:Name="MouseOverBorder" |
106 |
| - Opacity="0" |
107 |
| - Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}"/> |
108 |
| - <wpf:Ripple Feedback="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" |
109 |
| - Focusable="False" |
110 |
| - MinHeight="48" |
111 |
| - Content="{TemplateBinding Content}" |
112 |
| - ContentTemplate="{TemplateBinding ContentTemplate}" |
113 |
| - ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" |
114 |
| - SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
115 |
| - HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
116 |
| - VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
117 |
| - Padding="{TemplateBinding Padding}"/> |
118 |
| - </Grid> |
119 |
| - </ControlTemplate> |
120 |
| - </Setter.Value> |
121 |
| - </Setter> |
122 |
| - </Style> |
| 120 | + <Style TargetType="Button" BasedOn="{StaticResource MaterialDesignPopupBoxButton}" /> |
123 | 121 | </wpf:Card.Resources>
|
124 | 122 | </wpf:Card>
|
125 | 123 | </controlzEx:PopupEx>
|
|
0 commit comments