32 lines
777 B
C#
32 lines
777 B
C#
|
using Microsoft.UI.Xaml;
|
|||
|
using Microsoft.UI.Xaml.Controls;
|
|||
|
namespace RustTools.Themes;
|
|||
|
public sealed partial class ButtonIcon : UserControl
|
|||
|
{
|
|||
|
public ButtonIcon()
|
|||
|
{
|
|||
|
this.InitializeComponent();
|
|||
|
DefaultStyleKey = typeof(ButtonIcon);
|
|||
|
}
|
|||
|
|
|||
|
public string Glyph
|
|||
|
{
|
|||
|
get => (string)GetValue(GlyphProperty);
|
|||
|
set => SetValue(GlyphProperty, value);
|
|||
|
}
|
|||
|
public static readonly DependencyProperty GlyphProperty =
|
|||
|
DependencyProperty.Register("Glyph", typeof(string), typeof(ButtonIcon), new PropertyMetadata("\uE70A")); // <20><><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>ֵ
|
|||
|
public event RoutedEventHandler Click
|
|||
|
{
|
|||
|
add
|
|||
|
{
|
|||
|
button.Click += value;
|
|||
|
}
|
|||
|
remove
|
|||
|
{
|
|||
|
button.Click -= value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
}
|