Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3ac7a8

Browse files
github-actions[bot]PureWeen
authored andcommitted
[create-pull-request] automated change (#29760)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent cca44cd commit f3ac7a8

File tree

2 files changed

+135
-135
lines changed

2 files changed

+135
-135
lines changed

src/Controls/tests/TestCases.HostApp/FeatureMatrix/CheckBox/CheckBoxControlPage.xaml.cs

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,51 @@ namespace Maui.Controls.Sample;
66

77
public partial class CheckBoxControlPage : ContentPage
88
{
9-
private CheckBoxFeatureMatrixViewModel _viewModel;
10-
11-
public CheckBoxControlPage()
12-
{
13-
InitializeComponent();
14-
_viewModel = new CheckBoxFeatureMatrixViewModel();
15-
_viewModel.SetColorCommand = new Command<string>(OnSetColor);
16-
BindingContext = _viewModel;
17-
}
18-
19-
private void OnSetColor(string colorName)
20-
{
21-
switch (colorName)
22-
{
23-
case "Blue":
24-
_viewModel.Color = Colors.Blue;
25-
break;
26-
case "Green":
27-
_viewModel.Color = Colors.Green;
28-
break;
29-
case "Default":
30-
default:
31-
_viewModel.Color = null;
32-
break;
33-
}
34-
}
35-
36-
private void NavigateToOptionsPage_Clicked(object sender, EventArgs e)
37-
{
38-
_viewModel = new CheckBoxFeatureMatrixViewModel();
39-
_viewModel.SetColorCommand = new Command<string>(OnSetColor);
40-
BindingContext = _viewModel;
41-
}
42-
43-
private void OnCheckBoxCheckedChanged(object sender, CheckedChangedEventArgs e)
44-
{
45-
_viewModel.CheckedChangedCommand.Execute(null);
46-
}
9+
private CheckBoxFeatureMatrixViewModel _viewModel;
10+
11+
public CheckBoxControlPage()
12+
{
13+
InitializeComponent();
14+
_viewModel = new CheckBoxFeatureMatrixViewModel();
15+
_viewModel.SetColorCommand = new Command<string>(OnSetColor);
16+
BindingContext = _viewModel;
17+
}
18+
19+
private void OnSetColor(string colorName)
20+
{
21+
switch (colorName)
22+
{
23+
case "Blue":
24+
_viewModel.Color = Colors.Blue;
25+
break;
26+
case "Green":
27+
_viewModel.Color = Colors.Green;
28+
break;
29+
case "Default":
30+
default:
31+
_viewModel.Color = null;
32+
break;
33+
}
34+
}
35+
36+
private void NavigateToOptionsPage_Clicked(object sender, EventArgs e)
37+
{
38+
_viewModel = new CheckBoxFeatureMatrixViewModel();
39+
_viewModel.SetColorCommand = new Command<string>(OnSetColor);
40+
BindingContext = _viewModel;
41+
}
42+
43+
private void OnCheckBoxCheckedChanged(object sender, CheckedChangedEventArgs e)
44+
{
45+
_viewModel.CheckedChangedCommand.Execute(null);
46+
}
4747

4848
}
4949

5050

5151
// Extension of the CheckBoxFeatureMatrixViewModel to add commands for the options page
5252
public partial class CheckBoxFeatureMatrixViewModel
5353
{
54-
public ICommand SetColorCommand { get; set; }
54+
public ICommand SetColorCommand { get; set; }
5555
}
5656

src/Controls/tests/TestCases.HostApp/FeatureMatrix/CheckBox/CheckBoxViewModel.cs

Lines changed: 96 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -8,111 +8,111 @@ namespace Maui.Controls.Sample;
88

99
public partial class CheckBoxFeatureMatrixViewModel : INotifyPropertyChanged
1010
{
11-
private bool _isChecked = true;
12-
private Color _color = null;
13-
private bool _isEnabled = true;
14-
private bool _isVisible = true;
15-
private string _checkedChangedStatus = string.Empty;
16-
private bool _isEventStatusLabelVisible = false;
11+
private bool _isChecked = true;
12+
private Color _color = null;
13+
private bool _isEnabled = true;
14+
private bool _isVisible = true;
15+
private string _checkedChangedStatus = string.Empty;
16+
private bool _isEventStatusLabelVisible = false;
1717

18-
public event PropertyChangedEventHandler PropertyChanged;
18+
public event PropertyChangedEventHandler PropertyChanged;
1919

20-
public CheckBoxFeatureMatrixViewModel()
21-
{
22-
CheckedChangedCommand = new Command(OnCheckedChanged);
23-
}
20+
public CheckBoxFeatureMatrixViewModel()
21+
{
22+
CheckedChangedCommand = new Command(OnCheckedChanged);
23+
}
2424

25-
public bool IsChecked
26-
{
27-
get => _isChecked;
28-
set
29-
{
30-
if (_isChecked != value)
31-
{
32-
_isChecked = value;
33-
OnPropertyChanged();
34-
}
35-
}
36-
}
25+
public bool IsChecked
26+
{
27+
get => _isChecked;
28+
set
29+
{
30+
if (_isChecked != value)
31+
{
32+
_isChecked = value;
33+
OnPropertyChanged();
34+
}
35+
}
36+
}
3737

38-
public Color Color
39-
{
40-
get => _color;
41-
set
42-
{
43-
if (_color != value)
44-
{
45-
_color = value;
46-
OnPropertyChanged();
47-
}
48-
}
49-
}
38+
public Color Color
39+
{
40+
get => _color;
41+
set
42+
{
43+
if (_color != value)
44+
{
45+
_color = value;
46+
OnPropertyChanged();
47+
}
48+
}
49+
}
5050

51-
public bool IsEnabled
52-
{
53-
get => _isEnabled;
54-
set
55-
{
56-
if (_isEnabled != value)
57-
{
58-
_isEnabled = value;
59-
OnPropertyChanged();
60-
}
61-
}
62-
}
51+
public bool IsEnabled
52+
{
53+
get => _isEnabled;
54+
set
55+
{
56+
if (_isEnabled != value)
57+
{
58+
_isEnabled = value;
59+
OnPropertyChanged();
60+
}
61+
}
62+
}
6363

64-
public bool IsVisible
65-
{
66-
get => _isVisible;
67-
set
68-
{
69-
if (_isVisible != value)
70-
{
71-
_isVisible = value;
72-
OnPropertyChanged();
73-
}
74-
}
75-
}
64+
public bool IsVisible
65+
{
66+
get => _isVisible;
67+
set
68+
{
69+
if (_isVisible != value)
70+
{
71+
_isVisible = value;
72+
OnPropertyChanged();
73+
}
74+
}
75+
}
7676

77-
public string CheckedChangedStatus
78-
{
79-
get => _checkedChangedStatus;
80-
set
81-
{
82-
if (_checkedChangedStatus != value)
83-
{
84-
if (!string.IsNullOrEmpty(value))
85-
{
86-
IsEventStatusLabelVisible = true;
87-
}
88-
_checkedChangedStatus = value;
89-
OnPropertyChanged();
90-
}
91-
}
92-
}
77+
public string CheckedChangedStatus
78+
{
79+
get => _checkedChangedStatus;
80+
set
81+
{
82+
if (_checkedChangedStatus != value)
83+
{
84+
if (!string.IsNullOrEmpty(value))
85+
{
86+
IsEventStatusLabelVisible = true;
87+
}
88+
_checkedChangedStatus = value;
89+
OnPropertyChanged();
90+
}
91+
}
92+
}
9393

94-
public bool IsEventStatusLabelVisible
95-
{
96-
get => _isEventStatusLabelVisible;
97-
set
98-
{
99-
if (_isEventStatusLabelVisible != value)
100-
{
101-
_isEventStatusLabelVisible = value;
102-
OnPropertyChanged();
103-
}
104-
}
105-
}
94+
public bool IsEventStatusLabelVisible
95+
{
96+
get => _isEventStatusLabelVisible;
97+
set
98+
{
99+
if (_isEventStatusLabelVisible != value)
100+
{
101+
_isEventStatusLabelVisible = value;
102+
OnPropertyChanged();
103+
}
104+
}
105+
}
106106

107-
public ICommand CheckedChangedCommand { get; }
107+
public ICommand CheckedChangedCommand { get; }
108108

109-
private void OnCheckedChanged()
110-
{
111-
CheckedChangedStatus = "CheckedChanged Triggered";
112-
}
109+
private void OnCheckedChanged()
110+
{
111+
CheckedChangedStatus = "CheckedChanged Triggered";
112+
}
113113

114-
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
115-
{
116-
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
117-
}
114+
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
115+
{
116+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
117+
}
118118
}

0 commit comments

Comments
 (0)