Skip to content

Commit 3bf88b8

Browse files
Merge pull request #4510 from huynhsontung/fluent-icons
TextIconExtension to use Segoe Fluent Icons by default
2 parents 4f394ce + dc0f575 commit 3bf88b8

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

Microsoft.Toolkit.Uwp.UI/Extensions/Markup/Abstract/TextIconExtension.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ public abstract class TextIconExtension : MarkupExtension
2020
public double FontSize { get; set; }
2121

2222
[ThreadStatic]
23-
private static FontFamily segoeMDL2AssetsFontFamily;
23+
private static FontFamily symbolThemeFontFamily;
2424

2525
/// <summary>
26-
/// Gets the reusable "Segoe MDL2 Assets" <see cref="FontFamily"/> instance.
26+
/// Gets the reusable "Segoe Fluent Icons,Segoe MDL2 Assets" <see cref="FontFamily"/> instance.
2727
/// </summary>
28-
protected static FontFamily SegoeMDL2AssetsFontFamily
28+
protected static FontFamily SymbolThemeFontFamily
2929
{
30-
get => segoeMDL2AssetsFontFamily ??= new FontFamily("Segoe MDL2 Assets");
30+
get => symbolThemeFontFamily ??= new FontFamily("Segoe Fluent Icons,Segoe MDL2 Assets");
3131
}
3232

3333
/// <summary>

Microsoft.Toolkit.Uwp.UI/Extensions/Markup/FontIconExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class FontIconExtension : TextIconExtension
2020
public string Glyph { get; set; }
2121

2222
/// <summary>
23-
/// Gets or sets the font family to use to display the icon. If <see langword="null"/>, "Segoe MDL2 Assets" will be used.
23+
/// Gets or sets the font family to use to display the icon. If <see langword="null"/>, "Segoe Fluent Icons,Segoe MDL2 Assets" will be used.
2424
/// </summary>
2525
public FontFamily FontFamily { get; set; }
2626

@@ -30,7 +30,7 @@ protected override object ProvideValue()
3030
var fontIcon = new FontIcon
3131
{
3232
Glyph = Glyph,
33-
FontFamily = FontFamily ?? SegoeMDL2AssetsFontFamily,
33+
FontFamily = FontFamily ?? SymbolThemeFontFamily,
3434
FontWeight = FontWeight,
3535
FontStyle = FontStyle,
3636
IsTextScaleFactorEnabled = IsTextScaleFactorEnabled,

Microsoft.Toolkit.Uwp.UI/Extensions/Markup/FontIconSourceExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class FontIconSourceExtension : TextIconExtension
2020
public string Glyph { get; set; }
2121

2222
/// <summary>
23-
/// Gets or sets the font family to use to display the icon. If <see langword="null"/>, "Segoe MDL2 Assets" will be used.
23+
/// Gets or sets the font family to use to display the icon. If <see langword="null"/>, "Segoe Fluent Icons,Segoe MDL2 Assets" will be used.
2424
/// </summary>
2525
public FontFamily FontFamily { get; set; }
2626

@@ -30,7 +30,7 @@ protected override object ProvideValue()
3030
var fontIcon = new FontIconSource
3131
{
3232
Glyph = Glyph,
33-
FontFamily = FontFamily ?? SegoeMDL2AssetsFontFamily,
33+
FontFamily = FontFamily ?? SymbolThemeFontFamily,
3434
FontWeight = FontWeight,
3535
FontStyle = FontStyle,
3636
IsTextScaleFactorEnabled = IsTextScaleFactorEnabled,

Microsoft.Toolkit.Uwp.UI/Extensions/Markup/SymbolIconExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected override object ProvideValue()
2424
var fontIcon = new FontIcon
2525
{
2626
Glyph = unchecked((char)Symbol).ToString(),
27-
FontFamily = SegoeMDL2AssetsFontFamily,
27+
FontFamily = SymbolThemeFontFamily,
2828
FontWeight = FontWeight,
2929
FontStyle = FontStyle,
3030
IsTextScaleFactorEnabled = IsTextScaleFactorEnabled,

Microsoft.Toolkit.Uwp.UI/Extensions/Markup/SymbolIconSourceExtension.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected override object ProvideValue()
2424
var fontIcon = new FontIconSource
2525
{
2626
Glyph = unchecked((char)Symbol).ToString(),
27-
FontFamily = SegoeMDL2AssetsFontFamily,
27+
FontFamily = SymbolThemeFontFamily,
2828
FontWeight = FontWeight,
2929
FontStyle = FontStyle,
3030
IsTextScaleFactorEnabled = IsTextScaleFactorEnabled,

UnitTests/UnitTests.UWP/Extensions/Test_FontIconExtensionMarkupExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class Test_FontIconExtensionMarkupExtension
1717
{
1818
[TestCategory("FontIconExtensionMarkupExtension")]
1919
[UITestMethod]
20-
public void Test_FontIconExtension_MarkupExtension_ProvideSegoeMdl2Asset()
20+
public void Test_FontIconExtension_MarkupExtension_ProvideSymbolThemeFont()
2121
{
2222
var treeroot = XamlReader.Load(@"<Page
2323
xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
@@ -35,7 +35,7 @@ public void Test_FontIconExtension_MarkupExtension_ProvideSegoeMdl2Asset()
3535
Assert.IsNotNull(icon, $"Could not find the {nameof(FontIcon)} element in button.");
3636

3737
Assert.AreEqual(icon.Glyph, "\uE105", "Expected icon glyph to be E105.");
38-
Assert.AreEqual(icon.FontFamily.Source, "Segoe MDL2 Assets", "Expected font family to be Segoe MDL2 Assets");
38+
Assert.AreEqual(icon.FontFamily.Source, "Segoe Fluent Icons,Segoe MDL2 Assets", "Expected font family to be \"Segoe Fluent Icons,Segoe MDL2 Assets\"");
3939
}
4040

4141
[TestCategory("FontIconExtensionMarkupExtension")]

UnitTests/UnitTests.UWP/Extensions/Test_FontIconSourceExtensionMarkupExtension.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class Test_FontIconSourceExtensionMarkupExtension
1818
{
1919
[TestCategory("FontIconSourceExtensionMarkupExtension")]
2020
[UITestMethod]
21-
public void Test_FontIconSourceExtension_MarkupExtension_ProvideSegoeMdl2Asset()
21+
public void Test_FontIconSourceExtension_MarkupExtension_ProvideSymbolThemeFont()
2222
{
2323
var treeRoot = XamlReader.Load(@"<Page
2424
xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
@@ -37,7 +37,7 @@ public void Test_FontIconSourceExtension_MarkupExtension_ProvideSegoeMdl2Asset()
3737
Assert.IsNotNull(icon, $"Could not find the {nameof(FontIcon)} element in button.");
3838

3939
Assert.AreEqual(icon.Glyph, "\uE105", "Expected icon glyph to be E105.");
40-
Assert.AreEqual(icon.FontFamily.Source, "Segoe MDL2 Assets", "Expected font family to be Segoe MDL2 Assets");
40+
Assert.AreEqual(icon.FontFamily.Source, "Segoe Fluent Icons,Segoe MDL2 Assets", "Expected font family to be \"Segoe Fluent Icons,Segoe MDL2 Assets\"");
4141
}
4242

4343
[TestCategory("FontIconSourceExtensionMarkupExtension")]

0 commit comments

Comments
 (0)