Skip to content

Commit 239fb5f

Browse files
[create-pull-request] automated change (dotnet#29759)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 98a62a2 commit 239fb5f

File tree

3 files changed

+69
-69
lines changed

3 files changed

+69
-69
lines changed

src/Controls/tests/DeviceTests/Memory/MemoryTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ void SetupBuilder()
4040
handlers.AddHandler<CarouselView, CarouselViewHandler>();
4141
handlers.AddHandler<CollectionView, CollectionViewHandler>();
4242
#if IOS || MACCATALYST
43-
handlers.AddHandler<CollectionView2,CollectionViewHandler2>();
44-
handlers.AddHandler<CarouselView2,CarouselViewHandler2>();
43+
handlers.AddHandler<CollectionView2, CollectionViewHandler2>();
44+
handlers.AddHandler<CarouselView2, CarouselViewHandler2>();
4545
#endif
4646
handlers.AddHandler<CheckBox, CheckBoxHandler>();
4747
handlers.AddHandler<DatePicker, DatePickerHandler>();
Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
11
namespace Maui.Controls.Sample.Issues;
22

33
[Issue(IssueTracker.Github, 20685, "MenuBarItem Commands not working on Mac Catalyst",
4-
PlatformAffected.All)]
4+
PlatformAffected.All)]
55
public class Issue20685 : TestShell
66
{
7-
protected override void Init()
8-
{
9-
var resultLabel = new Label
10-
{
11-
Text = "No action performed yet",
12-
FontSize = 18,
13-
HorizontalOptions = LayoutOptions.Center,
14-
AutomationId = "ResultLabel"
15-
};
7+
protected override void Init()
8+
{
9+
var resultLabel = new Label
10+
{
11+
Text = "No action performed yet",
12+
FontSize = 18,
13+
HorizontalOptions = LayoutOptions.Center,
14+
AutomationId = "ResultLabel"
15+
};
1616

17-
var menuItems = new MenuBarItem { Text = "MenuItems" };
18-
17+
var menuItems = new MenuBarItem { Text = "MenuItems" };
1918

20-
// 1. Menu item using Clicked event
21-
var clickedItem = new MenuFlyoutItem
22-
{
23-
Text = "Test Clicked Event",
24-
AutomationId = "ClickedEventItem"
25-
};
26-
clickedItem.Clicked += (s, e) => resultLabel.Text = "Clicked event handler executed";
27-
menuItems.Add(clickedItem);
2819

29-
// 2. Menu item using Command
30-
var commandItem = new MenuFlyoutItem
31-
{
32-
Text = "Test Command",
33-
AutomationId = "CommandItem",
34-
Command = new Command(() => resultLabel.Text = "Command executed")
35-
};
36-
menuItems.Add(commandItem);
20+
// 1. Menu item using Clicked event
21+
var clickedItem = new MenuFlyoutItem
22+
{
23+
Text = "Test Clicked Event",
24+
AutomationId = "ClickedEventItem"
25+
};
26+
clickedItem.Clicked += (s, e) => resultLabel.Text = "Clicked event handler executed";
27+
menuItems.Add(clickedItem);
3728

38-
// 3. Menu item using Command with parameter
39-
var parameterItem = new MenuFlyoutItem
40-
{
41-
Text = "Test Command Parameter",
42-
AutomationId = "CommandWithParamItem",
43-
Command = new Command<string>(param => resultLabel.Text = $"Command executed with parameter: {param}"),
44-
CommandParameter = "Test Parameter"
45-
};
46-
menuItems.Add(parameterItem);
29+
// 2. Menu item using Command
30+
var commandItem = new MenuFlyoutItem
31+
{
32+
Text = "Test Command",
33+
AutomationId = "CommandItem",
34+
Command = new Command(() => resultLabel.Text = "Command executed")
35+
};
36+
menuItems.Add(commandItem);
4737

48-
MenuBarItems.Add(menuItems);
38+
// 3. Menu item using Command with parameter
39+
var parameterItem = new MenuFlyoutItem
40+
{
41+
Text = "Test Command Parameter",
42+
AutomationId = "CommandWithParamItem",
43+
Command = new Command<string>(param => resultLabel.Text = $"Command executed with parameter: {param}"),
44+
CommandParameter = "Test Parameter"
45+
};
46+
menuItems.Add(parameterItem);
4947

50-
var contentPage = new ContentPage
51-
{
52-
Content = new VerticalStackLayout
53-
{
54-
Padding = new Thickness(20),
55-
Spacing = 20,
56-
HorizontalOptions = LayoutOptions.Fill,
57-
VerticalOptions = LayoutOptions.Center,
58-
Children =
59-
{
60-
new Label
61-
{
62-
Text = "MenuFlyoutItem Test",
63-
FontSize = 24,
64-
HorizontalOptions = LayoutOptions.Center
65-
},
66-
resultLabel,
67-
new Label
68-
{
69-
Text = "Use the menu bar at the top to test the commands",
70-
HorizontalOptions = LayoutOptions.Center,
71-
HorizontalTextAlignment = TextAlignment.Center
72-
}
73-
}
74-
}
75-
};
48+
MenuBarItems.Add(menuItems);
7649

77-
AddContentPage(contentPage);
78-
}
50+
var contentPage = new ContentPage
51+
{
52+
Content = new VerticalStackLayout
53+
{
54+
Padding = new Thickness(20),
55+
Spacing = 20,
56+
HorizontalOptions = LayoutOptions.Fill,
57+
VerticalOptions = LayoutOptions.Center,
58+
Children =
59+
{
60+
new Label
61+
{
62+
Text = "MenuFlyoutItem Test",
63+
FontSize = 24,
64+
HorizontalOptions = LayoutOptions.Center
65+
},
66+
resultLabel,
67+
new Label
68+
{
69+
Text = "Use the menu bar at the top to test the commands",
70+
HorizontalOptions = LayoutOptions.Center,
71+
HorizontalTextAlignment = TextAlignment.Center
72+
}
73+
}
74+
}
75+
};
76+
77+
AddContentPage(contentPage);
78+
}
7979
}

src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue23803.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public Issue23803(TestDevice device)
1717
public void VerifyClickAroundOverflowMenuItem()
1818
{
1919
App.Tap("More");
20-
#if WINDOWS
20+
#if WINDOWS
2121
var rect = App.WaitForElement("Tab18").GetRect();
2222
App.TapCoordinates(rect.X + 80, rect.Y + 15);
2323
App.WaitForElement("Button18");

0 commit comments

Comments
 (0)