質問編集履歴
2
コードの修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,7 +36,7 @@
|
|
36
36
|
|
37
37
|
get{
|
38
38
|
|
39
|
-
if (_Loaded == null) { return new DelegateCommand(load
|
39
|
+
if (_Loaded == null) { return _Loaded= new DelegateCommand(load); }
|
40
40
|
|
41
41
|
else { return _Loaded; }
|
42
42
|
|
@@ -46,7 +46,7 @@
|
|
46
46
|
|
47
47
|
|
48
48
|
|
49
|
-
public void load
|
49
|
+
public void load()
|
50
50
|
|
51
51
|
{
|
52
52
|
|
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
MessageBox.Show("Hello");
|
74
74
|
|
75
|
-
if (_Loaded == null) { return new DelegateCommand(load
|
75
|
+
if (_Loaded == null) { return _Loaded = new DelegateCommand(load); }
|
76
76
|
|
77
77
|
else { return _Loaded; }
|
78
78
|
|
@@ -82,7 +82,7 @@
|
|
82
82
|
|
83
83
|
|
84
84
|
|
85
|
-
public void load
|
85
|
+
public void load()
|
86
86
|
|
87
87
|
{
|
88
88
|
|
1
より詳細の説明を加えた
test
CHANGED
File without changes
|
test
CHANGED
@@ -4,7 +4,11 @@
|
|
4
4
|
|
5
5
|
|
6
6
|
|
7
|
+
xamlでは下のようにバインディングしています。
|
8
|
+
|
9
|
+
|
10
|
+
|
7
|
-
|
11
|
+
デバッグをしてみるとロード時にif内がtrueでreturn new DelegateCommand(loaded);まではいくのですがloaded関数は呼び出されていない(loadにブレークポイント置いても止まらない)といった感じです。
|
8
12
|
|
9
13
|
|
10
14
|
|
@@ -26,15 +30,15 @@
|
|
26
30
|
|
27
31
|
```
|
28
32
|
|
29
|
-
public DelegateCommand Loaded
|
33
|
+
public DelegateCommand Loaded
|
30
34
|
|
31
35
|
{
|
32
36
|
|
33
|
-
get
|
37
|
+
get{
|
34
38
|
|
35
|
-
{
|
39
|
+
if (_Loaded == null) { return new DelegateCommand(loaded); }
|
36
40
|
|
37
|
-
return
|
41
|
+
else { return _Loaded; }
|
38
42
|
|
39
43
|
}
|
40
44
|
|
@@ -60,15 +64,17 @@
|
|
60
64
|
|
61
65
|
```
|
62
66
|
|
63
|
-
public DelegateCommand Loaded
|
67
|
+
public DelegateCommand Loaded
|
64
68
|
|
65
69
|
{
|
66
70
|
|
67
|
-
get
|
71
|
+
get{
|
68
72
|
|
69
|
-
|
73
|
+
MessageBox.Show("Hello");
|
70
74
|
|
71
|
-
return new DelegateCommand(loaded);
|
75
|
+
if (_Loaded == null) { return new DelegateCommand(loaded); }
|
76
|
+
|
77
|
+
else { return _Loaded; }
|
72
78
|
|
73
79
|
}
|
74
80
|
|