|
24 | 24 |
|
25 | 25 | <converters:EqualityToVisibilityConverter x:Key="EqualityToVisibilityConverter" />
|
26 | 26 |
|
27 |
| - <Style x:Key="MaterialDesignToggleListBoxItem" TargetType="{x:Type ListBoxItem}"> |
| 27 | + <Style x:Key="MaterialDesignToolToggleListBoxItem" TargetType="{x:Type ListBoxItem}"> |
28 | 28 | <Setter Property="Background" Value="Transparent"/>
|
29 | 29 | <Setter Property="BorderThickness" Value="0"/>
|
30 | 30 | <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignDivider}"/>
|
|
60 | 60 | </VisualStateGroup>
|
61 | 61 | <VisualStateGroup Name="SelectionStates">
|
62 | 62 | <VisualStateGroup.Transitions>
|
63 |
| - <VisualTransition GeneratedDuration="0:0:0.6"/> |
| 63 | + <VisualTransition From="*" To="Selected"> |
| 64 | + <Storyboard> |
| 65 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedBackgroundBorder"> |
| 66 | + <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
| 67 | + </DoubleAnimationUsingKeyFrames> |
| 68 | + </Storyboard> |
| 69 | + </VisualTransition> |
| 70 | + <VisualTransition From="*" To="SelectedUnfocused"> |
| 71 | + <Storyboard> |
| 72 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedBackgroundBorder"> |
| 73 | + <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
| 74 | + </DoubleAnimationUsingKeyFrames> |
| 75 | + </Storyboard> |
| 76 | + </VisualTransition> |
| 77 | + <VisualTransition From="Selected" To="Unselected"> |
| 78 | + <Storyboard> |
| 79 | + <DoubleAnimation Storyboard.TargetName="SelectedBackgroundBorder" |
| 80 | + Storyboard.TargetProperty="Opacity" |
| 81 | + To="0" Duration="1"/> |
| 82 | + </Storyboard> |
| 83 | + </VisualTransition> |
64 | 84 | </VisualStateGroup.Transitions>
|
65 | 85 | <VisualState Name="Selected">
|
66 | 86 | <Storyboard>
|
67 | 87 | <DoubleAnimation Storyboard.TargetName="SelectedBackgroundBorder"
|
68 | 88 | Storyboard.TargetProperty="Opacity"
|
69 |
| - To="0.18" Duration="0"/> |
| 89 | + To="1" Duration="0"/> |
70 | 90 | <DoubleAnimation Storyboard.TargetName="SelectedBorder"
|
71 | 91 | Storyboard.TargetProperty="Opacity"
|
72 | 92 | To="1" Duration="0"/>
|
|
75 | 95 | <VisualState Name="Unselected"/>
|
76 | 96 | <VisualState Name="SelectedUnfocused">
|
77 | 97 | <Storyboard>
|
| 98 | + <DoubleAnimation Storyboard.TargetName="SelectedBackgroundBorder" |
| 99 | + Storyboard.TargetProperty="Opacity" |
| 100 | + To="1" Duration="0"/> |
78 | 101 | <DoubleAnimation Storyboard.TargetName="SelectedBorder"
|
79 | 102 | Storyboard.TargetProperty="Opacity"
|
80 |
| - To="0.03" Duration="0"/> |
| 103 | + To="1" Duration="0"/> |
81 | 104 | </Storyboard>
|
82 | 105 | </VisualState>
|
83 | 106 | </VisualStateGroup>
|
84 | 107 | </VisualStateManager.VisualStateGroups>
|
85 |
| - <Grid> |
| 108 | + <Grid Margin="0 0 -1 0"> |
86 | 109 | <Border x:Name="MouseOverBorder"
|
87 | 110 | Opacity="0"
|
88 | 111 | Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}"/>
|
89 | 112 | <Border x:Name="SelectedBackgroundBorder"
|
90 | 113 | Opacity="0"
|
91 |
| - Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" |
92 |
| - RenderTransformOrigin="0.5,0.5"> |
93 |
| - <Border.RenderTransform> |
94 |
| - <ScaleTransform ScaleX="1"/> |
95 |
| - </Border.RenderTransform> |
96 |
| - </Border> |
97 |
| - |
98 |
| - <materialDesign:Ripple Feedback="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" |
| 114 | + Background="{DynamicResource MaterialDesignDivider}" /> |
| 115 | + <materialDesign:Ripple x:Name="Ripple" Feedback="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" |
| 116 | + Opacity=".56" |
99 | 117 | Focusable="False"
|
100 | 118 | Content="{TemplateBinding Content}"
|
101 | 119 | ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
113 | 131 | BorderBrush="{DynamicResource MaterialDesignDivider}" />
|
114 | 132 | </Grid>
|
115 | 133 | </Border>
|
| 134 | + <ControlTemplate.Triggers> |
| 135 | + <Trigger Property="IsSelected" Value="True"> |
| 136 | + <Setter TargetName="Ripple" Property="Opacity" Value=".92" /> |
| 137 | + </Trigger> |
| 138 | + </ControlTemplate.Triggers> |
116 | 139 | </ControlTemplate>
|
117 | 140 | </Setter.Value>
|
118 | 141 | </Setter>
|
119 | 142 | </Style>
|
120 | 143 |
|
121 |
| - <Style x:Key="MaterialDesignToggleListBox" TargetType="{x:Type ListBox}"> |
| 144 | + <Style x:Key="MaterialDesignToolToggleListBox" TargetType="{x:Type ListBox}"> |
122 | 145 | <Setter Property="Background" Value="Transparent"/>
|
123 | 146 | <Setter Property="BorderBrush" Value="Transparent"/>
|
124 | 147 | <Setter Property="BorderThickness" Value="0"/>
|
|
128 | 151 | <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
129 | 152 | <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
130 | 153 | <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
131 |
| - <Setter Property="materialDesign:ListBoxAssist.IsQuickUnselectEnabled" Value="True" /> |
| 154 | + <Setter Property="materialDesign:ListBoxAssist.IsToggle" Value="True" /> |
132 | 155 | <Setter Property="VerticalContentAlignment" Value="Center"/>
|
133 |
| - <Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignToggleListBoxItem}"/> |
| 156 | + <Setter Property="ItemContainerStyle" Value="{StaticResource MaterialDesignToolToggleListBoxItem}"/> |
134 | 157 | <Setter Property="ItemsPanel">
|
135 | 158 | <Setter.Value>
|
136 | 159 | <ItemsPanelTemplate>
|
|
171 | 194 | </UserControl.Resources>
|
172 | 195 |
|
173 | 196 | <StackPanel Margin="8">
|
174 |
| - <ListBox Style="{StaticResource MaterialDesignToggleListBox}"> |
| 197 | + <ListBox Style="{StaticResource MaterialDesignToolToggleListBox}"> |
175 | 198 | <ListBoxItem>
|
176 | 199 | <materialDesign:PackIcon Kind="FormatAlignLeft"/>
|
177 | 200 | </ListBoxItem>
|
|
186 | 209 | </ListBoxItem>
|
187 | 210 | </ListBox>
|
188 | 211 |
|
189 |
| - <ListBox Style="{StaticResource MaterialDesignToggleListBox}" |
| 212 | + <ListBox Style="{StaticResource MaterialDesignToolToggleListBox}" |
190 | 213 | SelectionMode="Extended"
|
191 | 214 | Margin="0 8 0 0">
|
192 | 215 | <ListBoxItem>
|
|
195 | 218 | <ListBoxItem>
|
196 | 219 | <materialDesign:PackIcon Kind="FormatItalic"/>
|
197 | 220 | </ListBoxItem>
|
198 |
| - <ListBoxItem> |
| 221 | + <ListBoxItem x:Name="UnderlineCheckbox"> |
199 | 222 | <materialDesign:PackIcon Kind="FormatUnderline"/>
|
200 | 223 | </ListBoxItem>
|
201 | 224 | </ListBox>
|
202 | 225 |
|
| 226 | + <CheckBox IsChecked="{Binding ElementName=UnderlineCheckbox, Path=IsSelected}">Underline?</CheckBox> |
| 227 | + |
203 | 228 | </StackPanel>
|
204 | 229 |
|
205 | 230 | </UserControl>
|
0 commit comments