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_Office.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 ImageSource SelectedIcon { get { return (ImageSource)GetValue(HoverIconProperty); } set { SetValue(HoverIconProperty, value); } } public static readonly DependencyProperty HoverIconProperty = DependencyProperty.Register("SelectedIcon", typeof(ImageSource), 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))); } }