-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathPropertyItem.cs
More file actions
145 lines (114 loc) · 5.41 KB
/
PropertyItem.cs
File metadata and controls
145 lines (114 loc) · 5.41 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using HandyControl.Data;
namespace HandyControl.Controls;
public class PropertyItem : ListBoxItem
{
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
nameof(Value), typeof(object), typeof(PropertyItem), new PropertyMetadata(default(object)));
public object Value
{
get => GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
public static readonly DependencyProperty DisplayNameProperty = DependencyProperty.Register(
nameof(DisplayName), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string DisplayName
{
get => (string) GetValue(DisplayNameProperty);
set => SetValue(DisplayNameProperty, value);
}
public static readonly DependencyProperty PropertyNameProperty = DependencyProperty.Register(
nameof(PropertyName), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string PropertyName
{
get => (string) GetValue(PropertyNameProperty);
set => SetValue(PropertyNameProperty, value);
}
public static readonly DependencyProperty PropertyTypeProperty = DependencyProperty.Register(
nameof(PropertyType), typeof(Type), typeof(PropertyItem), new PropertyMetadata(default(Type)));
public Type PropertyType
{
get => (Type) GetValue(PropertyTypeProperty);
set => SetValue(PropertyTypeProperty, value);
}
public static readonly DependencyProperty PropertyTypeNameProperty = DependencyProperty.Register(
nameof(PropertyTypeName), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string PropertyTypeName
{
get => (string) GetValue(PropertyTypeNameProperty);
set => SetValue(PropertyTypeNameProperty, value);
}
public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register(
nameof(Description), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string Description
{
get => (string) GetValue(DescriptionProperty);
set => SetValue(DescriptionProperty, value);
}
public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register(
nameof(IsReadOnly), typeof(bool), typeof(PropertyItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsReadOnly
{
get => (bool) GetValue(IsReadOnlyProperty);
set => SetValue(IsReadOnlyProperty, ValueBoxes.BooleanBox(value));
}
public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register(
nameof(DefaultValue), typeof(object), typeof(PropertyItem), new PropertyMetadata(default(object)));
public object DefaultValue
{
get => GetValue(DefaultValueProperty);
set => SetValue(DefaultValueProperty, value);
}
public static readonly DependencyProperty CategoryProperty = DependencyProperty.Register(
nameof(Category), typeof(string), typeof(PropertyItem), new PropertyMetadata(default(string)));
public string Category
{
get => (string) GetValue(CategoryProperty);
set => SetValue(CategoryProperty, value);
}
public static readonly DependencyProperty CategoryOrderProperty = DependencyProperty.Register(
nameof(CategoryOrder), typeof(int), typeof(PropertyItem), new PropertyMetadata(default(int)));
public int CategoryOrder
{
get => (int) GetValue(CategoryOrderProperty);
set => SetValue(CategoryOrderProperty, value);
}
public static readonly DependencyProperty PropertyOrderProperty = DependencyProperty.Register(
nameof(PropertyOrder), typeof(int), typeof(PropertyItem), new PropertyMetadata(default(int)));
public int PropertyOrder
{
get => (int) GetValue(PropertyOrderProperty);
set => SetValue(PropertyOrderProperty, value);
}
public static readonly DependencyProperty EditorProperty = DependencyProperty.Register(
nameof(Editor), typeof(PropertyEditorBase), typeof(PropertyItem), new PropertyMetadata(default(PropertyEditorBase)));
public PropertyEditorBase Editor
{
get => (PropertyEditorBase) GetValue(EditorProperty);
set => SetValue(EditorProperty, value);
}
public static readonly DependencyProperty EditorElementProperty = DependencyProperty.Register(
nameof(EditorElement), typeof(FrameworkElement), typeof(PropertyItem), new PropertyMetadata(default(FrameworkElement)));
public FrameworkElement EditorElement
{
get => (FrameworkElement) GetValue(EditorElementProperty);
set => SetValue(EditorElementProperty, value);
}
public static readonly DependencyProperty IsExpandedEnabledProperty = DependencyProperty.Register(
nameof(IsExpandedEnabled), typeof(bool), typeof(PropertyItem), new PropertyMetadata(ValueBoxes.FalseBox));
public bool IsExpandedEnabled
{
get => (bool) GetValue(IsExpandedEnabledProperty);
set => SetValue(IsExpandedEnabledProperty, ValueBoxes.BooleanBox(value));
}
public PropertyDescriptor PropertyDescriptor { get; set; }
public virtual void InitElement()
{
if (Editor == null) return;
EditorElement = Editor.CreateElement(this);
Editor.CreateBinding(this, EditorElement);
}
}