File tree Expand file tree Collapse file tree 7 files changed +33
-33
lines changed
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/IconExtensions
Microsoft.Toolkit.Uwp.UI/Extensions/Markup Expand file tree Collapse file tree 7 files changed +33
-33
lines changed Original file line number Diff line number Diff line change 1010
1111 <CommandBar >
1212 <AppBarButton Icon =" {ex:FontIcon Glyph= }" />
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= }" />
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>
Original file line number Diff line number Diff line change 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."
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"
Load Diff This file was deleted.
Original file line number Diff line number Diff 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>
Original file line number Diff line number Diff 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>
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments