forked from Kinnara/ModernWpf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathControlExample.cs
83 lines (66 loc) · 2.21 KB
/
ControlExample.cs
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System.Windows;
using System.Windows.Controls;
using System.Windows.Markup;
namespace SamplesCommon
{
[ContentProperty(nameof(Example))]
public class ControlExample : Control
{
static ControlExample()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ControlExample), new FrameworkPropertyMetadata(typeof(ControlExample)));
}
#region HeaderText
public static readonly DependencyProperty HeaderTextProperty =
DependencyProperty.Register(
nameof(HeaderText),
typeof(string),
typeof(ControlExample),
new PropertyMetadata(string.Empty));
public string HeaderText
{
get => (string)GetValue(HeaderTextProperty);
set => SetValue(HeaderTextProperty, value);
}
#endregion
#region Example
public static readonly DependencyProperty ExampleProperty =
DependencyProperty.Register(
nameof(Example),
typeof(object),
typeof(ControlExample),
null);
public object Example
{
get => GetValue(ExampleProperty);
set => SetValue(ExampleProperty, value);
}
#endregion
#region Options
public static readonly DependencyProperty OptionsProperty =
DependencyProperty.Register(
nameof(Options),
typeof(object),
typeof(ControlExample),
null);
public object Options
{
get => GetValue(OptionsProperty);
set => SetValue(OptionsProperty, value);
}
#endregion
#region MaxContentWidth
public static readonly DependencyProperty MaxContentWidthProperty =
DependencyProperty.Register(
nameof(MaxContentWidth),
typeof(double),
typeof(ControlExample),
new PropertyMetadata(1028d));
public double MaxContentWidth
{
get => (double)GetValue(MaxContentWidthProperty);
set => SetValue(MaxContentWidthProperty, value);
}
#endregion
}
}