using System.Windows; using System.Windows.Controls; namespace WPFProject.Controls { public class IconTabItem : TabItem { public IconTabItem() : base() { Visibility = Visibility.Collapsed; } private string _icon; public string Icon { get => _icon; set => _icon = value; } private bool _isFont; public bool IsFont { get => _isFont; set => _isFont = value; } private Window _Body; public Window Body { get => _Body; set => _Body = value; } // 单Header的字体大小 public double HeaderFontSize { get { return (double)GetValue(HeaderFontSizeProperty); } set { SetValue(HeaderFontSizeProperty, value); } } // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... public static readonly DependencyProperty HeaderFontSizeProperty = DependencyProperty.Register("HeaderFontSize", typeof(double), typeof(IconTabItem), new PropertyMetadata(20.0)); } }