namespace NeoUI.Controls; using System.Windows; using System.Windows.Controls; /// /// 表示一个标题控件,继承自 TextBlock,用于显示不同大小的标题文本。 /// public class Heading : TextBlock { #region Properties /// /// 获取或设置标题的大小。 /// public static readonly DependencyProperty SizeProperty = DependencyProperty.Register(nameof(Size), typeof(HeadingSizes), typeof(Heading), new PropertyMetadata(HeadingSizes.Normal)); /// /// Gets/sets the size of the heading. /// public HeadingSizes Size { get => (HeadingSizes)GetValue(SizeProperty); set => SetValue(SizeProperty, value); } #endregion #region Constructors static Heading() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Heading), new FrameworkPropertyMetadata(typeof(Heading))); } #endregion } /// /// 定义了标题的不同大小选项。 /// public enum HeadingSizes : byte { /// /// 表示标题的额外大尺寸选项。 /// ExtraLarge, /// /// 表示标题的大尺寸选项。 /// Large, /// /// 表示标题的中等尺寸选项。 /// Medium, /// /// 表示标题的正常尺寸选项。 /// Normal, /// /// 表示标题的小尺寸选项。 /// Small, /// /// 表示标题的最小尺寸选项。 /// Tiny }