File tree Expand file tree Collapse file tree 4 files changed +7
-8
lines changed
Expand file tree Collapse file tree 4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public static void Register()
2727
2828 public bool IsSupported => true ;
2929
30- public void Apply ( IList < NativeMenuItem > items )
30+ public void Apply ( IReadOnlyList < NativeMenuItem > items )
3131 {
3232 // Clear existing menus first
3333 NativeMenuInterop . uno_menu_bar_clear ( ) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,6 @@ internal interface INativeMenuBarExtension
1919 /// Applies the menu items to the native menu bar.
2020 /// </summary>
2121 /// <param name="items">The collection of top-level menu items to apply.</param>
22- void Apply ( IList < NativeMenuItem > items ) ;
22+ void Apply ( IReadOnlyList < NativeMenuItem > items ) ;
2323}
2424#endif
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ partial void ApplyNativeMenuPartial()
1919 {
2020 // On iOS, menu bar integration requires buildMenu(with:) to be called from the UIApplicationDelegate.
2121 // This implementation stores the menu structure to be used when the system requests menu building.
22- NativeMenuBridgeiOS . SetMenuItems ( _items . ToList ( ) ) ;
22+ NativeMenuBridgeiOS . SetMenuItems ( _items ) ;
2323 }
2424}
2525
@@ -28,9 +28,9 @@ partial void ApplyNativeMenuPartial()
2828/// </summary>
2929internal static class NativeMenuBridgeiOS
3030{
31- private static List < NativeMenuItem > ? _menuItems ;
31+ private static IReadOnlyList < NativeMenuItem > ? _menuItems ;
3232
33- internal static void SetMenuItems ( List < NativeMenuItem > items )
33+ internal static void SetMenuItems ( IReadOnlyList < NativeMenuItem > items )
3434 {
3535 _menuItems = items ;
3636 }
@@ -42,7 +42,7 @@ internal static void SetMenuItems(List<NativeMenuItem> items)
4242 /// <param name="builder">The UIMenuBuilder provided by iOS.</param>
4343 public static void BuildMenu ( IUIMenuBuilder builder )
4444 {
45- if ( _menuItems == null || ! _menuItems . Any ( ) )
45+ if ( _menuItems == null || _menuItems . Count == 0 )
4646 {
4747 return ;
4848 }
Original file line number Diff line number Diff line change 11#if __SKIA__
22#nullable enable
33
4- using System . Linq ;
54using Uno . Foundation . Extensibility ;
65
76namespace Uno . UI . NativeMenu ;
@@ -18,7 +17,7 @@ static partial void IsNativeMenuSupportedPartial(ref bool isSupported)
1817
1918 partial void ApplyNativeMenuPartial ( )
2019 {
21- GetExtension ( ) ? . Apply ( _items . ToList ( ) ) ;
20+ GetExtension ( ) ? . Apply ( _items ) ;
2221 }
2322
2423 private static INativeMenuBarExtension ? GetExtension ( )
You can’t perform that action at this time.
0 commit comments