回答編集履歴
2
名前も変更
answer
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
前のLoadedのインスタンスは参照切れになります。
|
3
3
|
Viewの中でBindしたときに設定したLoadedのインスタンスがGCに回収されていれば呼ばれません。
|
4
4
|
|
5
|
-
似た書き方ですが、
|
5
|
+
~~似た書き方ですが、~~ 訂正しました。
|
6
6
|
``` C#
|
7
|
-
private DelegateCommand
|
7
|
+
private DelegateCommand _LoadedCommand;
|
8
|
-
public DelegateCommand
|
8
|
+
public DelegateCommand LoadedCommand =>
|
9
|
-
|
9
|
+
_LoadedCommand = _LoadedCommand ??
|
10
10
|
new DelegateCommand(loaded);
|
11
11
|
```
|
12
12
|
ならOKのはずです。
|
1
間違えました。
answer
CHANGED
@@ -4,7 +4,9 @@
|
|
4
4
|
|
5
5
|
似た書き方ですが、
|
6
6
|
``` C#
|
7
|
+
private DelegateCommand _Loaded;
|
7
|
-
public DelegateCommand Loaded
|
8
|
+
public DelegateCommand Loaded =>
|
9
|
+
_Loaded = _Loaded ??
|
8
|
-
|
10
|
+
new DelegateCommand(loaded);
|
9
11
|
```
|
10
12
|
ならOKのはずです。
|