質問編集履歴
2
レイアウトの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -192,7 +192,7 @@
|
|
192
192
|
|
193
193
|
|
194
194
|
|
195
|
-
public static readonly new DependencyProperty ValueProperty =
|
195
|
+
public static readonly new DependencyProperty ValueProperty =
|
196
196
|
|
197
197
|
DependencyProperty.Register("Value", typeof(object), typeof(UpDownBase), new PropertyMetadata((ulong)0));
|
198
198
|
|
@@ -212,4 +212,4 @@
|
|
212
212
|
|
213
213
|
エラーの内容
|
214
214
|
|
215
|
-
```ULongUpDown' のタイプ初期化子が例外をスローしました。```
|
215
|
+
```'ULongUpDown' のタイプ初期化子が例外をスローしました。```
|
1
追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -157,3 +157,59 @@
|
|
157
157
|
|
158
158
|
|
159
159
|
ご教授のほどよろしくお願いいたします。
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
###追記
|
164
|
+
|
165
|
+
どうやら```ValueProperty ```の```new PropertyMetadata(0)```の```0```がintだったのが直接的な原因だったようです。
|
166
|
+
|
167
|
+
しかし、ではそこをオーバーライドしようとするとこれまたエラーが出ます…
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
###
|
172
|
+
|
173
|
+
```C#
|
174
|
+
|
175
|
+
//派生させたクラス
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
public class ULongUpDown : UpDownBase //エラーになります
|
180
|
+
|
181
|
+
{
|
182
|
+
|
183
|
+
public ULongUpDown()
|
184
|
+
|
185
|
+
{
|
186
|
+
|
187
|
+
maxValue = (ulong)ulong.MaxValue;
|
188
|
+
|
189
|
+
minValue = (ulong)ulong.MinValue;
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
public static readonly new DependencyProperty ValueProperty =
|
196
|
+
|
197
|
+
DependencyProperty.Register("Value", typeof(object), typeof(UpDownBase), new PropertyMetadata((ulong)0));
|
198
|
+
|
199
|
+
public new ulong Value {
|
200
|
+
|
201
|
+
get { return (ulong)(GetValue(ValueProperty)); }
|
202
|
+
|
203
|
+
set { SetValue(ValueProperty, value); }
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
```
|
212
|
+
|
213
|
+
エラーの内容
|
214
|
+
|
215
|
+
```ULongUpDown' のタイプ初期化子が例外をスローしました。```
|