Skip to content

Commit ede52c5

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

File tree

10 files changed

+1571
-1571
lines changed

10 files changed

+1571
-1571
lines changed

src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellContentFragment.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,9 @@ void Destroy()
170170
{
171171
if (_destroyed)
172172
return;
173-
173+
174174
_destroyed = true;
175-
175+
176176
// If the user taps very quickly on back button multiple times to pop a page,
177177
// the app enters background state in the middle of the animation causing the fragment to be destroyed without completing the animation.
178178
// That'll cause `IAnimationListener.onAnimationEnd` to not be called, so we need to call it manually if something is still subscribed to the event

src/Controls/tests/DeviceTests/Elements/Shell/ShellTests.Android.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ public async Task ShellContentFragmentDestroyHandlesNullShellContext()
534534
},
535535
new ShellContent()
536536
{
537-
Route = "Item2",
537+
Route = "Item2",
538538
Content = new ContentPage { Title = "Page 2" }
539539
},
540540
}
@@ -555,12 +555,12 @@ await CreateHandlerAndAddToWindow<ShellHandler>(shell, async (handler) =>
555555
await OnNavigatedToAsync(shell.CurrentPage);
556556

557557
// Test null context scenario
558-
var exception = Record.Exception(() =>
558+
var exception = Record.Exception(() =>
559559
{
560560
// Create fragment with null context - this should not throw
561561
Page page = new ContentPage();
562562
var fragment = new ShellContentFragment((IShellContext)null, page);
563-
563+
564564
// Dispose the fragment which calls Destroy internally
565565
// This validates the null-conditional operators in Destroy method
566566
fragment.Dispose();

src/Controls/tests/TestCases.HostApp/FeatureMatrix/Editor/EditorControlPage.xaml.cs

Lines changed: 114 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -5,123 +5,123 @@ namespace Maui.Controls.Sample;
55

66
public class EditorControlPage : NavigationPage
77
{
8-
private EditorViewModel _viewModel;
8+
private EditorViewModel _viewModel;
99

10-
public EditorControlPage()
11-
{
12-
_viewModel = new EditorViewModel();
13-
PushAsync(new EditorControlMainPage(_viewModel));
14-
}
10+
public EditorControlPage()
11+
{
12+
_viewModel = new EditorViewModel();
13+
PushAsync(new EditorControlMainPage(_viewModel));
14+
}
1515
}
1616

1717
public partial class EditorControlMainPage : ContentPage
1818
{
19-
private EditorViewModel _viewModel;
20-
21-
public EditorControlMainPage(EditorViewModel viewModel)
22-
{
23-
InitializeComponent();
24-
_viewModel = viewModel;
25-
BindingContext = _viewModel;
26-
EditorControl.PropertyChanged += UpdateEditorControl;
27-
}
28-
29-
private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e)
30-
{
31-
BindingContext = _viewModel = new EditorViewModel();
32-
_viewModel.Text = "Test Editor";
33-
_viewModel.Placeholder = "Enter text here";
34-
_viewModel.VerticalTextAlignment = TextAlignment.End;
35-
_viewModel.CursorPosition = 0;
36-
_viewModel.SelectionLength = 0;
37-
_viewModel.HeightRequest = -1;
38-
await Navigation.PushAsync(new EditorOptionsPage(_viewModel));
39-
}
40-
41-
private void CursorPositionButton_Clicked(object sender, EventArgs e)
42-
{
43-
if (int.TryParse(CursorPositionEntry.Text, out int cursorPosition))
44-
{
45-
_viewModel.CursorPosition = cursorPosition;
46-
}
47-
}
48-
49-
private void SelectionLength_Clicked(object sender, EventArgs e)
50-
{
51-
if (int.TryParse(SelectionLengthEntry.Text, out int selectionLength))
52-
{
53-
_viewModel.SelectionLength = selectionLength;
54-
}
55-
}
56-
57-
private void OnUpdateCursorAndSelectionClicked(object sender, EventArgs e)
58-
{
59-
if (int.TryParse(CursorPositionEntry.Text, out int cursorPosition))
60-
{
61-
EditorControl.Focus();
62-
EditorControl.CursorPosition = cursorPosition;
63-
64-
if (BindingContext is EditorViewModel vm)
65-
vm.CursorPosition = cursorPosition;
66-
}
67-
68-
if (int.TryParse(SelectionLengthEntry.Text, out int selectionLength))
69-
{
70-
EditorControl.Focus();
71-
EditorControl.SelectionLength = selectionLength;
72-
73-
if (BindingContext is EditorViewModel vm)
74-
vm.SelectionLength = selectionLength;
75-
}
76-
CursorPositionEntry.Text = EditorControl.CursorPosition.ToString();
77-
SelectionLengthEntry.Text = EditorControl.SelectionLength.ToString();
78-
}
79-
80-
void UpdateEditorControl(object sender, PropertyChangedEventArgs args)
81-
{
82-
if (args.PropertyName == Editor.CursorPositionProperty.PropertyName)
83-
CursorPositionEntry.Text = EditorControl.CursorPosition.ToString();
84-
else if (args.PropertyName == Editor.SelectionLengthProperty.PropertyName)
85-
SelectionLengthEntry.Text = EditorControl.SelectionLength.ToString();
86-
}
87-
88-
private void EditorControl_TextChanged(object sender, TextChangedEventArgs e)
89-
{
90-
string eventInfo = $"TextChanged: Old='{e.OldTextValue}', New='{e.NewTextValue}'";
91-
92-
if (BindingContext is EditorViewModel vm)
93-
{
94-
vm.TextChangedText = eventInfo;
95-
}
96-
}
97-
98-
private void EditorControl_Completed(object sender, EventArgs e)
99-
{
100-
string eventInfo = $"Completed: Event Triggered";
101-
102-
if (BindingContext is EditorViewModel vm)
103-
{
104-
vm.CompletedText = eventInfo;
105-
}
106-
}
107-
108-
private void EditorControl_Focused(object sender, FocusEventArgs e)
109-
{
110-
string eventInfo = $"Focused: Event Triggered";
111-
112-
if (BindingContext is EditorViewModel vm)
113-
{
114-
vm.FocusedText = eventInfo;
115-
}
116-
}
117-
118-
private void EditorControl_Unfocused(object sender, FocusEventArgs e)
119-
{
120-
string eventInfo = $"Unfocused: Event Triggered";
121-
122-
if (BindingContext is EditorViewModel vm)
123-
{
124-
vm.UnfocusedText = eventInfo;
125-
}
126-
}
19+
private EditorViewModel _viewModel;
20+
21+
public EditorControlMainPage(EditorViewModel viewModel)
22+
{
23+
InitializeComponent();
24+
_viewModel = viewModel;
25+
BindingContext = _viewModel;
26+
EditorControl.PropertyChanged += UpdateEditorControl;
27+
}
28+
29+
private async void NavigateToOptionsPage_Clicked(object sender, EventArgs e)
30+
{
31+
BindingContext = _viewModel = new EditorViewModel();
32+
_viewModel.Text = "Test Editor";
33+
_viewModel.Placeholder = "Enter text here";
34+
_viewModel.VerticalTextAlignment = TextAlignment.End;
35+
_viewModel.CursorPosition = 0;
36+
_viewModel.SelectionLength = 0;
37+
_viewModel.HeightRequest = -1;
38+
await Navigation.PushAsync(new EditorOptionsPage(_viewModel));
39+
}
40+
41+
private void CursorPositionButton_Clicked(object sender, EventArgs e)
42+
{
43+
if (int.TryParse(CursorPositionEntry.Text, out int cursorPosition))
44+
{
45+
_viewModel.CursorPosition = cursorPosition;
46+
}
47+
}
48+
49+
private void SelectionLength_Clicked(object sender, EventArgs e)
50+
{
51+
if (int.TryParse(SelectionLengthEntry.Text, out int selectionLength))
52+
{
53+
_viewModel.SelectionLength = selectionLength;
54+
}
55+
}
56+
57+
private void OnUpdateCursorAndSelectionClicked(object sender, EventArgs e)
58+
{
59+
if (int.TryParse(CursorPositionEntry.Text, out int cursorPosition))
60+
{
61+
EditorControl.Focus();
62+
EditorControl.CursorPosition = cursorPosition;
63+
64+
if (BindingContext is EditorViewModel vm)
65+
vm.CursorPosition = cursorPosition;
66+
}
67+
68+
if (int.TryParse(SelectionLengthEntry.Text, out int selectionLength))
69+
{
70+
EditorControl.Focus();
71+
EditorControl.SelectionLength = selectionLength;
72+
73+
if (BindingContext is EditorViewModel vm)
74+
vm.SelectionLength = selectionLength;
75+
}
76+
CursorPositionEntry.Text = EditorControl.CursorPosition.ToString();
77+
SelectionLengthEntry.Text = EditorControl.SelectionLength.ToString();
78+
}
79+
80+
void UpdateEditorControl(object sender, PropertyChangedEventArgs args)
81+
{
82+
if (args.PropertyName == Editor.CursorPositionProperty.PropertyName)
83+
CursorPositionEntry.Text = EditorControl.CursorPosition.ToString();
84+
else if (args.PropertyName == Editor.SelectionLengthProperty.PropertyName)
85+
SelectionLengthEntry.Text = EditorControl.SelectionLength.ToString();
86+
}
87+
88+
private void EditorControl_TextChanged(object sender, TextChangedEventArgs e)
89+
{
90+
string eventInfo = $"TextChanged: Old='{e.OldTextValue}', New='{e.NewTextValue}'";
91+
92+
if (BindingContext is EditorViewModel vm)
93+
{
94+
vm.TextChangedText = eventInfo;
95+
}
96+
}
97+
98+
private void EditorControl_Completed(object sender, EventArgs e)
99+
{
100+
string eventInfo = $"Completed: Event Triggered";
101+
102+
if (BindingContext is EditorViewModel vm)
103+
{
104+
vm.CompletedText = eventInfo;
105+
}
106+
}
107+
108+
private void EditorControl_Focused(object sender, FocusEventArgs e)
109+
{
110+
string eventInfo = $"Focused: Event Triggered";
111+
112+
if (BindingContext is EditorViewModel vm)
113+
{
114+
vm.FocusedText = eventInfo;
115+
}
116+
}
117+
118+
private void EditorControl_Unfocused(object sender, FocusEventArgs e)
119+
{
120+
string eventInfo = $"Unfocused: Event Triggered";
121+
122+
if (BindingContext is EditorViewModel vm)
123+
{
124+
vm.UnfocusedText = eventInfo;
125+
}
126+
}
127127
}

0 commit comments

Comments
 (0)