Main页面
This commit is contained in:
1 parent
a003d90b0e
commit
f03e2b08f4
33 files changed
+54543
-34
No files matched your search
@@ -0,0 +1,42 @@
|
||||
using PipeReviewReport.Resources.Fonts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Store.Management.Framework.Controls
|
||||
{
|
||||
public class IconText : TextBlock
|
||||
{
|
||||
static IconText()
|
||||
{
|
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(IconText), new FrameworkPropertyMetadata(typeof(IconText)));
|
||||
}
|
||||
|
||||
|
||||
public IconNameEnum Icon
|
||||
{
|
||||
get => (IconNameEnum)GetValue(IconNameProperty);
|
||||
set => SetValue(IconNameProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IconNameProperty = DependencyProperty.Register(
|
||||
nameof(Icon),
|
||||
typeof(IconNameEnum),
|
||||
typeof(IconText),
|
||||
new PropertyMetadata(IconNameEnum.Empty, OnIconChanged)
|
||||
);
|
||||
|
||||
private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is IconText self)
|
||||
{
|
||||
self.Text = self.Icon.GetGlyphString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user