chenghaoran
2024-02-06 ee0ccdd8306da736205e26c8851c21b2650e3230
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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));
 
    }
}