3
3
xmlns : wpf =" clr-namespace:MaterialDesignThemes.Wpf"
4
4
xmlns : converters =" clr-namespace:MaterialDesignThemes.Wpf.Converters" >
5
5
6
- <BooleanToVisibilityConverter x : Key =" BooleanToVisibilityConverter" />
7
- <converters : NullableToVisibilityConverter x : Key =" NullableToVisibilityConverter" />
6
+ <ResourceDictionary .MergedDictionaries>
7
+ <ResourceDictionary >
8
+ <BooleanToVisibilityConverter x : Key =" BooleanToVisibilityConverter" />
9
+ <converters : NullableToVisibilityConverter x : Key =" NullableToVisibilityConverter" />
10
+ <converters : BrushRoundConverter x : Key =" BrushRoundConverter" />
11
+ </ResourceDictionary >
12
+ </ResourceDictionary .MergedDictionaries>
8
13
9
14
<!-- not happy with where the tool tip is going right now -->
10
15
<!--
160
165
</Setter .Value>
161
166
</Setter >
162
167
</Style >
168
+
169
+ <Style x : Key =" MaterialDesignOutlineChip" TargetType =" {x:Type wpf:Chip}" >
170
+ <Setter Property =" Foreground" Value =" {DynamicResource MaterialDesignBody}" />
171
+ <Setter Property =" Background" Value =" {DynamicResource MaterialDesignBodyLight}" />
172
+ <Setter Property =" BorderBrush" Value =" {DynamicResource MaterialDesignDivider}" />
173
+ <Setter Property =" BorderThickness" Value =" 1" />
174
+ <Setter Property =" Template" >
175
+ <Setter .Value>
176
+ <ControlTemplate TargetType =" {x:Type wpf:Chip}" >
177
+ <Grid >
178
+ <Grid .ColumnDefinitions>
179
+ <ColumnDefinition Width =" Auto" />
180
+ <ColumnDefinition Width =" *" />
181
+ <ColumnDefinition Width =" Auto" />
182
+ </Grid .ColumnDefinitions>
183
+ <Border CornerRadius =" 16" x : Name =" Border" BorderThickness =" {TemplateBinding BorderThickness}" BorderBrush =" {TemplateBinding BorderBrush}" Grid.ColumnSpan=" 3" />
184
+ <Border x : Name =" MouseOverBorder"
185
+ Opacity =" 0"
186
+ CornerRadius =" 16"
187
+ Grid.ColumnSpan=" 2"
188
+ BorderThickness =" {TemplateBinding BorderThickness}" BorderBrush =" {TemplateBinding BorderBrush}"
189
+ Grid.Column=" 0"
190
+ Background =" {TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" />
191
+ <ContentControl Content =" {TemplateBinding Icon}"
192
+ x : Name =" IconControl"
193
+ Background =" {TemplateBinding IconBackground}"
194
+ Foreground =" {TemplateBinding IconForeground}"
195
+ FontSize =" 17"
196
+ FontWeight =" Regular"
197
+ IsTabStop =" False"
198
+ Visibility =" {TemplateBinding Icon, Converter={StaticResource NullableToVisibilityConverter}}"
199
+ VerticalAlignment =" Center"
200
+ VerticalContentAlignment =" Center"
201
+ HorizontalContentAlignment =" Center"
202
+ Height =" 32" Width =" 32" >
203
+ <ContentControl .Clip>
204
+ <EllipseGeometry RadiusX =" 16" RadiusY =" 16" Center =" 16,16" />
205
+ </ContentControl .Clip>
206
+ <ContentControl .Template>
207
+ <ControlTemplate TargetType =" ContentControl" >
208
+ <Border Background =" {TemplateBinding Background}" >
209
+ <ContentPresenter Content =" {TemplateBinding Content}"
210
+ HorizontalAlignment =" {TemplateBinding HorizontalContentAlignment}"
211
+ VerticalAlignment =" {TemplateBinding VerticalContentAlignment}" />
212
+ </Border >
213
+ </ControlTemplate >
214
+ </ContentControl .Template>
215
+ </ContentControl >
216
+ <ContentControl Content =" {TemplateBinding Content}"
217
+ ContentTemplate =" {TemplateBinding ContentTemplate}"
218
+ ContentTemplateSelector =" {TemplateBinding ContentTemplateSelector}"
219
+ ContentStringFormat =" {TemplateBinding ContentTemplateSelector}"
220
+ x : Name =" TextBlock"
221
+ IsTabStop =" False"
222
+ VerticalAlignment =" Center"
223
+ Margin =" 8 0 12 0"
224
+ Grid.Column=" 1" />
225
+ <Button Grid.Column=" 2" Visibility =" {TemplateBinding IsDeletable, Converter={StaticResource BooleanToVisibilityConverter}}"
226
+ x : Name =" PART_DeleteButton"
227
+ ToolTip =" {TemplateBinding DeleteToolTip}"
228
+ Margin =" -6 0 8 0"
229
+ VerticalAlignment =" Center"
230
+ Width =" 16" Height =" 16" >
231
+ <Button .Template>
232
+ <ControlTemplate >
233
+ <Grid >
234
+ <Ellipse x : Name =" Bg" Fill =" #FFA6A6A6" Stroke =" #FF009587" StrokeThickness =" 0" />
235
+ <wpf : PackIcon Kind =" Close" Width =" 12" Height =" 12"
236
+ HorizontalAlignment =" Center"
237
+ VerticalAlignment =" Center" />
238
+ </Grid >
239
+ <ControlTemplate .Triggers>
240
+ <Trigger Property =" IsMouseOver" Value =" True" >
241
+ <Setter TargetName =" Bg" Property =" StrokeThickness" Value =" 1" />
242
+ </Trigger >
243
+ </ControlTemplate .Triggers>
244
+ </ControlTemplate >
245
+ </Button .Template>
246
+ </Button >
247
+ <VisualStateManager .VisualStateGroups>
248
+ <VisualStateGroup Name =" CommonStates" >
249
+ <VisualStateGroup .Transitions>
250
+ <VisualTransition GeneratedDuration =" 0:0:0.3" To =" Normal" >
251
+ <VisualTransition .GeneratedEasingFunction>
252
+ <CircleEase EasingMode =" EaseOut" />
253
+ </VisualTransition .GeneratedEasingFunction>
254
+ </VisualTransition >
255
+ </VisualStateGroup .Transitions>
256
+ <VisualState Name =" Normal" />
257
+ <VisualState Name =" MouseOver" >
258
+ <Storyboard >
259
+ <DoubleAnimation Storyboard.TargetName=" MouseOverBorder"
260
+ Storyboard.TargetProperty=" Opacity"
261
+ To =" 0.1" Duration =" 0" />
262
+ </Storyboard >
263
+ </VisualState >
264
+ <VisualState Name =" Disabled" />
265
+ </VisualStateGroup >
266
+ </VisualStateManager .VisualStateGroups>
267
+ </Grid >
268
+ <ControlTemplate .Triggers>
269
+ <Trigger SourceName =" IconControl" Property =" Visibility" Value =" Collapsed" >
270
+ <Setter TargetName =" TextBlock" Property =" Margin" Value =" 12 0 12 0" />
271
+ </Trigger >
272
+ </ControlTemplate .Triggers>
273
+ </ControlTemplate >
274
+ </Setter .Value>
275
+ </Setter >
276
+ </Style >
163
277
</ResourceDictionary >
0 commit comments