file scoped namespaces (#565)
This commit is contained in:
@@ -1,35 +1,34 @@
|
||||
using Windows.UI.Xaml;
|
||||
using Wino.Core.UWP.Controls;
|
||||
|
||||
namespace Wino.Controls
|
||||
namespace Wino.Controls;
|
||||
|
||||
public partial class WinoFontIconSource : Microsoft.UI.Xaml.Controls.FontIconSource
|
||||
{
|
||||
public partial class WinoFontIconSource : Microsoft.UI.Xaml.Controls.FontIconSource
|
||||
public WinoIconGlyph Icon
|
||||
{
|
||||
public WinoIconGlyph Icon
|
||||
{
|
||||
get { return (WinoIconGlyph)GetValue(IconProperty); }
|
||||
set { SetValue(IconProperty, value); }
|
||||
}
|
||||
get { return (WinoIconGlyph)GetValue(IconProperty); }
|
||||
set { SetValue(IconProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(nameof(Icon), typeof(WinoIconGlyph), typeof(WinoFontIconSource), new PropertyMetadata(WinoIconGlyph.Flag, OnIconChanged));
|
||||
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(nameof(Icon), typeof(WinoIconGlyph), typeof(WinoFontIconSource), new PropertyMetadata(WinoIconGlyph.Flag, OnIconChanged));
|
||||
|
||||
public WinoFontIconSource()
|
||||
{
|
||||
FontFamily = new Windows.UI.Xaml.Media.FontFamily("ms-appx:///Assets/WinoIcons.ttf#WinoIcons");
|
||||
FontSize = 32;
|
||||
}
|
||||
public WinoFontIconSource()
|
||||
{
|
||||
FontFamily = new Windows.UI.Xaml.Media.FontFamily("ms-appx:///Assets/WinoIcons.ttf#WinoIcons");
|
||||
FontSize = 32;
|
||||
}
|
||||
|
||||
private static void OnIconChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
|
||||
private static void OnIconChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
|
||||
{
|
||||
if (obj is WinoFontIconSource fontIcon)
|
||||
{
|
||||
if (obj is WinoFontIconSource fontIcon)
|
||||
{
|
||||
fontIcon.UpdateGlyph();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateGlyph()
|
||||
{
|
||||
Glyph = ControlConstants.WinoIconFontDictionary[Icon];
|
||||
fontIcon.UpdateGlyph();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateGlyph()
|
||||
{
|
||||
Glyph = ControlConstants.WinoIconFontDictionary[Icon];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user