Skip to content

Commit 0a77566

Browse files
committed
Aligned APIs to original UWP ones, fixed docs
1 parent ff85e54 commit 0a77566

File tree

7 files changed

+33
-33
lines changed

7 files changed

+33
-33
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/IconExtensions/IconExtensionsPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
<CommandBar>
1212
<AppBarButton Icon="{ex:FontIcon Glyph=&#xE102;}"/>
13-
<AppBarButton Icon="{ex:SymbolIcon Glyph=Play}"/>
13+
<AppBarButton Icon="{ex:SymbolIcon Symbol=Play}"/>
1414
</CommandBar>
1515

1616
<SwipeControl>
1717
<SwipeControl.LeftItems>
1818
<SwipeItems Mode="Reveal">
1919
<SwipeItem Text="Accept" IconSource="{ex:FontIconSource Glyph=&#xE10B;}"/>
20-
<SwipeItem Text="Play" IconSource="{ex:SymbolIconSource Glyph=Play}"/>
20+
<SwipeItem Text="Play" IconSource="{ex:SymbolIconSource Symbol=Play}"/>
2121
<SwipeItem IconSource="{ex:BitmapIconSource Source=/Assets/ToolkitLogo.png}"/>
2222
</SwipeItems>
2323
</SwipeControl.LeftItems>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/IconExtensions/IconExtensionsXaml.bind

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
Style="{StaticResource BodyTextBlockStyle}"/>
2727

2828
<CommandBar>
29-
<AppBarButton Icon="{ex:SymbolIcon Glyph=Play}"/>
30-
<AppBarButton Icon="{ex:SymbolIcon Glyph=Pause}"/>
31-
<AppBarButton Icon="{ex:SymbolIcon Glyph=Home}"/>
29+
<AppBarButton Icon="{ex:SymbolIcon Symbol=Play}"/>
30+
<AppBarButton Icon="{ex:SymbolIcon Symbol=Pause}"/>
31+
<AppBarButton Icon="{ex:SymbolIcon Symbol=Home}"/>
3232
</CommandBar>
3333

3434
<TextBlock Text="Use the FontIconSource extension to create FontIconSource items from custom glyphs."
@@ -76,8 +76,8 @@
7676
Width="300" Margin="12" Height="68">
7777
<SwipeControl.LeftItems>
7878
<SwipeItems Mode="Reveal">
79-
<SwipeItem Text="Accept" IconSource="{ex:FontIconSource Glyph=Accept}"/>
80-
<SwipeItem Text="Flag" IconSource="{ex:FontIconSource Glyph=Flag}"/>
79+
<SwipeItem Text="Accept" IconSource="{ex:SymbolIconSource Symbol=Accept}"/>
80+
<SwipeItem Text="Flag" IconSource="{ex:SymbolIconSource Symbol=Flag}"/>
8181
</SwipeItems>
8282
</SwipeControl.LeftItems>
8383
<TextBlock Text="Swipe Right"

Microsoft.Toolkit.Uwp.UI/Extensions/Markup/Abstract/TextIconExtension{T}.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ namespace Microsoft.Toolkit.Uwp.UI.Extensions
1212
/// Custom <see cref="MarkupExtension"/> which can provide <see cref="FontIcon"/> values.
1313
/// </summary>
1414
[MarkupExtensionReturnType(ReturnType = typeof(FontIcon))]
15-
public class FontIconExtension : TextIconExtension<string>
15+
public class FontIconExtension : TextIconExtension
1616
{
17+
/// <summary>
18+
/// Gets or sets the <see cref="string"/> value representing the icon to display.
19+
/// </summary>
20+
public string Glyph { get; set; }
21+
1722
/// <summary>
1823
/// Gets or sets the font family to use to display the icon. If <see langword="null"/>, "Segoe MDL2 Assets" will be used.
1924
/// </summary>

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ namespace Microsoft.Toolkit.Uwp.UI.Extensions
1212
/// Custom <see cref="MarkupExtension"/> which can provide <see cref="FontIconSource"/> values.
1313
/// </summary>
1414
[MarkupExtensionReturnType(ReturnType = typeof(FontIconSource))]
15-
public class FontIconSourceExtension : TextIconExtension<string>
15+
public class FontIconSourceExtension : TextIconExtension
1616
{
17+
/// <summary>
18+
/// Gets or sets the <see cref="string"/> value representing the icon to display.
19+
/// </summary>
20+
public string Glyph { get; set; }
21+
1722
/// <summary>
1823
/// Gets or sets the font family to use to display the icon. If <see langword="null"/>, "Segoe MDL2 Assets" will be used.
1924
/// </summary>

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Extensions
1111
/// Custom <see cref="MarkupExtension"/> which can provide symbol-baased <see cref="FontIcon"/> values.
1212
/// </summary>
1313
[MarkupExtensionReturnType(ReturnType = typeof(FontIcon))]
14-
public class SymbolIconExtension : TextIconExtension<Symbol>
14+
public class SymbolIconExtension : TextIconExtension
1515
{
16+
/// <summary>
17+
/// Gets or sets the <see cref="Windows.UI.Xaml.Controls.Symbol"/> value representing the icon to display.
18+
/// </summary>
19+
public Symbol Symbol { get; set; }
20+
1621
/// <inheritdoc/>
1722
protected override object ProvideValue()
1823
{
1924
var fontIcon = new FontIcon
2025
{
21-
Glyph = unchecked((char)Glyph).ToString(),
26+
Glyph = unchecked((char)Symbol).ToString(),
2227
FontFamily = SegoeMDL2AssetsFontFamily,
2328
FontWeight = FontWeight,
2429
FontStyle = FontStyle,

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@ namespace Microsoft.Toolkit.Uwp.UI.Extensions
1111
/// Custom <see cref="MarkupExtension"/> which can provide symbol-baased <see cref="FontIconSource"/> values.
1212
/// </summary>
1313
[MarkupExtensionReturnType(ReturnType = typeof(FontIconSource))]
14-
public class SymbolIconSourceExtension : TextIconExtension<Symbol>
14+
public class SymbolIconSourceExtension : TextIconExtension
1515
{
16+
/// <summary>
17+
/// Gets or sets the <see cref="Windows.UI.Xaml.Controls.Symbol"/> value representing the icon to display.
18+
/// </summary>
19+
public Symbol Symbol { get; set; }
20+
1621
/// <inheritdoc/>
1722
protected override object ProvideValue()
1823
{
1924
var fontIcon = new FontIconSource
2025
{
21-
Glyph = unchecked((char)Glyph).ToString(),
26+
Glyph = unchecked((char)Symbol).ToString(),
2227
FontFamily = SegoeMDL2AssetsFontFamily,
2328
FontWeight = FontWeight,
2429
FontStyle = FontStyle,

0 commit comments

Comments
 (0)