using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Media; namespace PDF_Master.CustomControl { /// /// 显示图标和选中文字颜色的TabItem /// public class IconAndTextTabItem:TabItem { public IconAndTextTabItem() { } public override void OnApplyTemplate() { base.OnApplyTemplate(); } public PathGeometry NormalPathIcon { get { return (PathGeometry)GetValue(NormalIconProperty); } set { SetValue(NormalIconProperty, value); } } public static readonly DependencyProperty NormalIconProperty = DependencyProperty.Register("NormalPathIcon", typeof(PathGeometry), typeof(IconAndTextTabItem), new PropertyMetadata(null)); public PathGeometry SelectedIcon { get { return (PathGeometry)GetValue(HoverIconProperty); } set { SetValue(HoverIconProperty, value); } } public static readonly DependencyProperty HoverIconProperty = DependencyProperty.Register("SelectedIcon", typeof(PathGeometry), typeof(IconAndTextTabItem), new PropertyMetadata(null)); public SolidColorBrush SelectedForeground { get { return (SolidColorBrush)GetValue(SelectedForegroundProperty); } set { SetValue(SelectedForegroundProperty, value); } } public static readonly DependencyProperty SelectedForegroundProperty = DependencyProperty.Register("SelectedForeground", typeof(SolidColorBrush), typeof(IconAndTextTabItem), new PropertyMetadata(new SolidColorBrush(Colors.Black))); } }