@@ -10,37 +10,27 @@ namespace AiEffects.TestApp.ViewModels
10
10
public class ForInvestigationViewModel
11
11
{
12
12
public ReactivePropertySlim < Color > BackColor { get ; } = new ReactivePropertySlim < Color > ( ) ;
13
- public List < string > ItemsSource { get ; set ; } = new List < string > ( ) ;
14
-
13
+
15
14
public ReactiveCommand GoCommand { get ; set ; } = new ReactiveCommand ( ) ;
16
15
17
- public ReactiveCommand CellCommand { get ; set ; } = new ReactiveCommand ( ) ;
16
+ public ReactiveCommand HogeCommand { get ; set ; }
17
+
18
+ public ReactivePropertySlim < bool > CanExecute { get ; } = new ReactivePropertySlim < bool > ( ) ;
18
19
19
20
public ForInvestigationViewModel ( INavigationService navigationService )
20
21
{
21
22
BackColor . Value = Color . Blue ;
22
-
23
- ItemsSource . Add ( "ABC" ) ;
24
- ItemsSource . Add ( "CC" ) ;
25
- ItemsSource . Add ( "DD" ) ;
26
- ItemsSource . Add ( "EEE" ) ;
27
- ItemsSource . Add ( "FFF" ) ;
28
- ItemsSource . Add ( "GADSFS" ) ;
29
- ItemsSource . Add ( "HDSGDG" ) ;
30
- ItemsSource . Add ( "IGDG" ) ;
31
- ItemsSource . Add ( "YYUY" ) ;
32
- ItemsSource . Add ( "XXX" ) ;
23
+
33
24
34
25
var toggle = false ;
35
26
GoCommand . Subscribe ( async _ =>
36
27
{
37
- //BackColor.Value = toggle ? Color.Blue : Color.Green;
38
- //toggle = !toggle;
39
- //await navigationService.NavigateAsync("MainPage",null,true);
40
- await navigationService . GoBackAsync ( ) ;
28
+ CanExecute . Value = ! CanExecute . Value ;
41
29
} ) ;
42
30
43
- CellCommand . Subscribe ( _ =>
31
+ HogeCommand = CanExecute . ToReactiveCommand ( ) ;
32
+
33
+ HogeCommand . Subscribe ( _ =>
44
34
{
45
35
Debug . WriteLine ( "Cell Tap!" ) ;
46
36
} ) ;
0 commit comments