Skip to content

Commit a6bc8de

Browse files
committed
fix: add GeometryConverter to PathIcon Data property
1 parent ee1a7cd commit a6bc8de

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/MahApps.Metro/Controls/Icons/PathIcon.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5+
using System.ComponentModel;
56
using System.Windows;
67
using System.Windows.Media;
78
using System.Windows.Shapes;
@@ -23,6 +24,7 @@ public static readonly DependencyProperty DataProperty
2324
/// <summary>
2425
/// Gets or sets a Geometry that specifies the shape to be drawn. In XAML this can also be set using the Path Markup Syntax.
2526
/// </summary>
27+
[TypeConverter(typeof(GeometryConverter))]
2628
public Geometry? Data
2729
{
2830
get => (Geometry?)this.GetValue(DataProperty);

src/Mahapps.Metro.Tests/Tests/TextBoxHelperTests.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,16 @@ public async Task TestAttachedPropertyButtonContent()
6464
await this.fixture.PrepareForTestAsync(new[] { TextBoxHelper.ButtonContentProperty.Name });
6565
await TestHost.SwitchToAppThread();
6666

67-
var content = "42";
67+
var content = "M237.5 75A12.5 12.5 0 0 0 237.5 100A12.5 12.5 0 0 1 250 112.5V212.5A12.5 12.5 0 0 1 237.5 225H142.6875L136.8 241.675A12.5125 12.5125 0 0 1 125 250H62.5A12.5 12.5 0 0 1 50 237.5V112.5A12.5 12.5 0 0 1 62.5 100A12.5 12.5 0 0 0 62.5 75A37.5 37.5 0 0 0 25 112.5V237.5A37.5 37.5 0 0 0 62.5 275H125C141.325 275 155.2125 264.5625 160.375 250H237.5A37.5 37.5 0 0 0 275 212.5V112.5A37.5 37.5 0 0 0 237.5 75zM174.875 76.2A62.525 62.525 0 0 0 96.2125 172.5375A62.5 62.5 0 0 0 192.55 93.875L228.8 57.625A12.5 12.5 0 0 0 211.1125 39.9625L174.8625 76.2000000000001zM166.925 101.825A37.5 37.5 0 1 1 113.875 154.875A37.5 37.5 0 0 1 166.9125 101.8375z";
6868

69-
this.fixture.Window?.TestTextBox.SetValue(TextBoxHelper.ButtonContentProperty, content);
70-
Assert.Equal(content, this.fixture.Window?.TestTextBox.FindChild<Button>("PART_ClearText")?.Content);
7169
this.fixture.Window?.TestButtonTextBox.SetValue(TextBoxHelper.ButtonContentProperty, content);
7270
Assert.Equal(content, this.fixture.Window?.TestButtonTextBox.FindChild<Button>("PART_ClearText")?.Content);
7371

72+
content = "42";
73+
74+
this.fixture.Window?.TestTextBox.SetValue(TextBoxHelper.ButtonContentProperty, content);
75+
Assert.Equal(content, this.fixture.Window?.TestTextBox.FindChild<Button>("PART_ClearText")?.Content);
76+
7477
this.fixture.Window?.TestPasswordBox.SetValue(TextBoxHelper.ButtonContentProperty, content);
7578
Assert.Equal(content, this.fixture.Window?.TestPasswordBox.FindChild<Button>("PART_ClearText")?.Content);
7679
this.fixture.Window?.TestButtonRevealedPasswordBox.SetValue(TextBoxHelper.ButtonContentProperty, content);

0 commit comments

Comments
 (0)