IconAndTextTabItem.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Media;
  9. namespace PDF_Master.CustomControl
  10. {
  11. /// <summary>
  12. /// 显示图标和选中文字颜色的TabItem
  13. /// </summary>
  14. public class IconAndTextTabItem:TabItem
  15. {
  16. public IconAndTextTabItem()
  17. {
  18. }
  19. public override void OnApplyTemplate()
  20. {
  21. base.OnApplyTemplate();
  22. }
  23. public PathGeometry NormalPathIcon
  24. {
  25. get { return (PathGeometry)GetValue(NormalIconProperty); }
  26. set { SetValue(NormalIconProperty, value); }
  27. }
  28. public static readonly DependencyProperty NormalIconProperty =
  29. DependencyProperty.Register("NormalPathIcon", typeof(PathGeometry), typeof(IconAndTextTabItem), new PropertyMetadata(null));
  30. public PathGeometry SelectedIcon
  31. {
  32. get { return (PathGeometry)GetValue(HoverIconProperty); }
  33. set { SetValue(HoverIconProperty, value); }
  34. }
  35. public static readonly DependencyProperty HoverIconProperty =
  36. DependencyProperty.Register("SelectedIcon", typeof(PathGeometry), typeof(IconAndTextTabItem), new PropertyMetadata(null));
  37. public SolidColorBrush SelectedForeground
  38. {
  39. get { return (SolidColorBrush)GetValue(SelectedForegroundProperty); }
  40. set { SetValue(SelectedForegroundProperty, value); }
  41. }
  42. public static readonly DependencyProperty SelectedForegroundProperty =
  43. DependencyProperty.Register("SelectedForeground", typeof(SolidColorBrush), typeof(IconAndTextTabItem), new PropertyMetadata(new SolidColorBrush(Colors.Black)));
  44. }
  45. }