質問編集履歴
3
文法の修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -48,16 +48,12 @@
|
|
48
48
|
```
|
49
49
|
|
50
50
|
### 発生している問題・エラーメッセージ
|
51
|
-
this.CheckItems.Value としているため、以下の処理を行うとAnyCheckedの通知?が来なくなってしまいます。
|
51
|
+
this.AnyChecked = this.CheckItems.Value としているため、以下の処理を行うとAnyCheckedの通知?が来なくなってしまいます。
|
52
52
|
```CSharp
|
53
53
|
Model.BaseCheckItems.Value = new List<Check>(){ new Check() };
|
54
54
|
```
|
55
55
|
this.CheckItems.Valueを変更してもAnyCheckedに通知が来るようにはどのように書いたら良いでしょうか?
|
56
56
|
|
57
|
-
### 試したこと
|
58
|
-
|
59
|
-
ここに問題に対して試したことを記載してください。
|
60
|
-
|
61
57
|
### 補足情報(FW/ツールのバージョンなど)
|
62
58
|
VisualStudio2017 C# WPF
|
63
59
|
ReactiveProperty 4.1.1
|
2
タグ追加
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|
1
誤字修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,8 @@
|
|
7
7
|
|
8
8
|
```CSharp
|
9
9
|
static class Model{
|
10
|
-
public static ReactiveProperty<List<
|
10
|
+
public static ReactiveProperty<List<Check>> BaseCheckItems {get;}
|
11
|
+
= new ReactiveProperty<List<Check>>( new List<Check>(){ new Check(), new Check() } );
|
11
12
|
}
|
12
13
|
|
13
14
|
class ViewModel {
|
@@ -16,16 +17,16 @@
|
|
16
17
|
this.AnyChecked = this.CheckItems.Value
|
17
18
|
.Select( x => x.IsChecked )
|
18
19
|
.CombineLatest( x => x.Any( z => z ) )
|
19
|
-
.
|
20
|
+
.ToReactiveProperty();
|
20
21
|
|
21
22
|
this.ButtonCommand = this.AnyChecked.ToReactiveCommand();
|
22
23
|
}
|
23
|
-
public ReactiveProperty<List<
|
24
|
+
public ReactiveProperty<List<Check>> CheckItems {get;}
|
24
25
|
public ReactiveProperty<bool> AnyChecked {get;}
|
25
26
|
public ReactiveCommand ButtonCommand {get;}
|
26
27
|
}
|
27
28
|
|
28
|
-
class
|
29
|
+
public class Check {
|
29
30
|
public ReactiveProperty<bool> IsChecked {get;} = new ReactiveProperty<bool>();
|
30
31
|
}
|
31
32
|
```
|