@@ -26,123 +26,49 @@ public event RoutedPropertyChangedEventHandler<decimal> ValueYChanged
26
26
remove => RemoveHandler ( ValueYChangedEvent , value ) ;
27
27
}
28
28
29
- public static readonly DependencyProperty HideUpDownButtonsProperty = DependencyProperty . Register (
30
- nameof ( HideUpDownButtons ) ,
31
- typeof ( bool ) ,
32
- typeof ( DecimalXyBox ) ,
33
- new PropertyMetadata ( BooleanBoxes . FalseBox ) ) ;
34
-
35
- public bool HideUpDownButtons
36
- {
37
- get => ( bool ) GetValue ( HideUpDownButtonsProperty ) ;
38
- set => SetValue ( HideUpDownButtonsProperty , value ) ;
39
- }
40
-
41
- public static readonly DependencyProperty MaximumProperty = DependencyProperty . Register (
42
- nameof ( Maximum ) ,
43
- typeof ( decimal ) ,
44
- typeof ( DecimalXyBox ) ,
45
- new FrameworkPropertyMetadata (
46
- decimal . MaxValue ,
47
- FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ) ;
48
-
49
- public decimal Maximum
50
- {
51
- get => ( decimal ) GetValue ( MaximumProperty ) ;
52
- set => SetValue ( MaximumProperty , value ) ;
53
- }
54
-
55
- public static readonly DependencyProperty MinimumProperty = DependencyProperty . Register (
56
- nameof ( Minimum ) ,
57
- typeof ( decimal ) ,
58
- typeof ( DecimalXyBox ) ,
59
- new FrameworkPropertyMetadata (
60
- decimal . MinValue ,
61
- FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ) ;
62
-
63
- public decimal Minimum
64
- {
65
- get => ( decimal ) GetValue ( MinimumProperty ) ;
66
- set => SetValue ( MinimumProperty , value ) ;
67
- }
68
-
69
- public static readonly DependencyProperty PrefixTextXProperty = DependencyProperty . Register (
70
- nameof ( PrefixTextX ) ,
71
- typeof ( string ) ,
72
- typeof ( DecimalXyBox ) ,
73
- new FrameworkPropertyMetadata (
74
- string . Empty ,
75
- FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ) ;
76
-
77
- public string PrefixTextX
78
- {
79
- get => ( string ) GetValue ( PrefixTextXProperty ) ;
80
- set => SetValue ( PrefixTextXProperty , value ) ;
81
- }
82
-
83
- public static readonly DependencyProperty PrefixTextYProperty = DependencyProperty . Register (
84
- nameof ( PrefixTextY ) ,
85
- typeof ( string ) ,
86
- typeof ( DecimalXyBox ) ,
87
- new FrameworkPropertyMetadata (
88
- string . Empty ,
89
- FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ) ;
90
-
91
- public string PrefixTextY
92
- {
93
- get => ( string ) GetValue ( PrefixTextYProperty ) ;
94
- set => SetValue ( PrefixTextYProperty , value ) ;
95
- }
96
-
97
- public static readonly DependencyProperty SuffixTextProperty = DependencyProperty . Register (
98
- nameof ( SuffixText ) ,
99
- typeof ( string ) ,
100
- typeof ( DecimalXyBox ) ,
101
- new FrameworkPropertyMetadata (
102
- string . Empty ,
103
- FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ) ;
104
-
105
- public string SuffixText
106
- {
107
- get => ( string ) GetValue ( SuffixTextProperty ) ;
108
- set => SetValue ( SuffixTextProperty , value ) ;
109
- }
110
-
111
- public static readonly DependencyProperty ValueXProperty = DependencyProperty . Register (
112
- nameof ( ValueX ) ,
113
- typeof ( decimal ) ,
114
- typeof ( DecimalXyBox ) ,
115
- new FrameworkPropertyMetadata (
116
- defaultValue : 0m ,
117
- FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ,
118
- OnValueXLostFocus ,
119
- coerceValueCallback : null ,
120
- isAnimationProhibited : true ,
121
- UpdateSourceTrigger . LostFocus ) ) ;
122
-
123
- public decimal ValueX
124
- {
125
- get => ( decimal ) GetValue ( ValueXProperty ) ;
126
- set => SetValue ( ValueXProperty , value ) ;
127
- }
128
-
129
- public static readonly DependencyProperty ValueYProperty = DependencyProperty . Register (
130
- nameof ( ValueY ) ,
131
- typeof ( decimal ) ,
132
- typeof ( DecimalXyBox ) ,
133
- new FrameworkPropertyMetadata (
134
- defaultValue : 0m ,
135
- FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ,
136
- OnValueYLostFocus ,
137
- coerceValueCallback : null ,
138
- isAnimationProhibited : true ,
139
- UpdateSourceTrigger . LostFocus ) ) ;
140
-
141
- public decimal ValueY
142
- {
143
- get => ( decimal ) GetValue ( ValueYProperty ) ;
144
- set => SetValue ( ValueYProperty , value ) ;
145
- }
29
+ [ DependencyProperty ( DefaultValue = false ) ]
30
+ private bool hideUpDownButtons ;
31
+
32
+ [ DependencyProperty (
33
+ DefaultValue = PropertyDefaultValueConstants . MinValue ,
34
+ Flags = FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ]
35
+ private decimal minimum ;
36
+
37
+ [ DependencyProperty (
38
+ DefaultValue = PropertyDefaultValueConstants . MaxValue ,
39
+ Flags = FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ]
40
+ private decimal maximum ;
41
+
42
+ [ DependencyProperty (
43
+ DefaultValue = "" ,
44
+ Flags = FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ]
45
+ private string prefixTextX ;
46
+
47
+ [ DependencyProperty (
48
+ DefaultValue = "" ,
49
+ Flags = FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ]
50
+ private string prefixTextY ;
51
+
52
+ [ DependencyProperty (
53
+ DefaultValue = "" ,
54
+ Flags = FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ) ]
55
+ private string suffixText ;
56
+
57
+ [ DependencyProperty (
58
+ DefaultValue = 0 ,
59
+ Flags = FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ,
60
+ PropertyChangedCallback = nameof ( OnValueXLostFocus ) ,
61
+ IsAnimationProhibited = true ,
62
+ DefaultUpdateSourceTrigger = UpdateSourceTrigger . LostFocus ) ]
63
+ private decimal valueX ;
64
+
65
+ [ DependencyProperty (
66
+ DefaultValue = 0 ,
67
+ Flags = FrameworkPropertyMetadataOptions . BindsTwoWayByDefault | FrameworkPropertyMetadataOptions . Journal ,
68
+ PropertyChangedCallback = nameof ( OnValueYLostFocus ) ,
69
+ IsAnimationProhibited = true ,
70
+ DefaultUpdateSourceTrigger = UpdateSourceTrigger . LostFocus ) ]
71
+ private decimal valueY ;
146
72
147
73
public event EventHandler < ValueChangedEventArgs < decimal ? > > ? ValueXLostFocus ;
148
74
@@ -162,7 +88,11 @@ private void OnValueXChanged(
162
88
return ;
163
89
}
164
90
165
- RaiseEvent ( new RoutedPropertyChangedEventArgs < decimal > ( ( decimal ) e . OldValue , ( decimal ) e . NewValue , ValueXChangedEvent ) ) ;
91
+ RaiseEvent (
92
+ new RoutedPropertyChangedEventArgs < decimal > (
93
+ ( decimal ) e . OldValue ,
94
+ ( decimal ) e . NewValue ,
95
+ ValueXChangedEvent ) ) ;
166
96
}
167
97
168
98
private void OnValueYChanged (
@@ -174,7 +104,11 @@ private void OnValueYChanged(
174
104
return ;
175
105
}
176
106
177
- RaiseEvent ( new RoutedPropertyChangedEventArgs < decimal > ( ( decimal ) e . OldValue , ( decimal ) e . NewValue , ValueYChangedEvent ) ) ;
107
+ RaiseEvent (
108
+ new RoutedPropertyChangedEventArgs < decimal > (
109
+ ( decimal ) e . OldValue ,
110
+ ( decimal ) e . NewValue ,
111
+ ValueYChangedEvent ) ) ;
178
112
}
179
113
180
114
private static void OnValueXLostFocus (
0 commit comments