diff --git a/src/Compatibility/Core/src/Windows/CellControl.cs b/src/Compatibility/Core/src/Windows/CellControl.cs index a0c6635c560d..3e8253f1628d 100644 --- a/src/Compatibility/Core/src/Windows/CellControl.cs +++ b/src/Compatibility/Core/src/Windows/CellControl.cs @@ -16,6 +16,8 @@ using Microsoft.Maui.Graphics; using Microsoft.Maui.Controls.Handlers.Compatibility; using Microsoft.Maui.Controls.Platform; +using WMenuFlyout = Microsoft.UI.Xaml.Controls.MenuFlyout; +using WFlyoutBase = Microsoft.UI.Xaml.Controls.Primitives.FlyoutBase; namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP { @@ -284,9 +286,9 @@ void OnLongTap(object sender, HoldingRoutedEventArgs e) /// /// To check the context, not just the text. /// - MenuFlyout GetAttachedFlyout() + WMenuFlyout GetAttachedFlyout() { - if (FlyoutBase.GetAttachedFlyout(CellContent) is MenuFlyout flyout) + if (WFlyoutBase.GetAttachedFlyout(CellContent) is WMenuFlyout flyout) { var actions = Cell.ContextActions; if (flyout.Items.Count != actions.Count) @@ -306,16 +308,16 @@ void OpenContextMenu() { if (GetAttachedFlyout() == null) { - var flyout = new MenuFlyout(); + var flyout = new WMenuFlyout(); SetupMenuItems(flyout); ((INotifyCollectionChanged)Cell.ContextActions).CollectionChanged += OnContextActionsChanged; _contextActions = Cell.ContextActions; - FlyoutBase.SetAttachedFlyout(CellContent, flyout); + WFlyoutBase.SetAttachedFlyout(CellContent, flyout); } - FlyoutBase.ShowAttachedFlyout(CellContent); + WFlyoutBase.ShowAttachedFlyout(CellContent); } void SetCell(object newContext) @@ -441,7 +443,7 @@ void SetupContextMenu() _contextActions = null; } - FlyoutBase.SetAttachedFlyout(CellContent, null); + WFlyoutBase.SetAttachedFlyout(CellContent, null); return; } @@ -449,9 +451,9 @@ void SetupContextMenu() CellContent.Holding += OnLongTap; } - void SetupMenuItems(MenuFlyout flyout) + void SetupMenuItems(WMenuFlyout flyout) { - foreach (MenuItem item in Cell.ContextActions) + foreach (var item in Cell.ContextActions) { var flyoutItem = new Microsoft.UI.Xaml.Controls.MenuFlyoutItem(); flyoutItem.SetBinding(UI.Xaml.Controls.MenuFlyoutItem.TextProperty, "Text"); diff --git a/src/Controls/samples/Controls.Sample.Sandbox/Maui.Controls.Sample.Sandbox.csproj b/src/Controls/samples/Controls.Sample.Sandbox/Maui.Controls.Sample.Sandbox.csproj index 078cee17bcb8..89d2a6d7397b 100644 --- a/src/Controls/samples/Controls.Sample.Sandbox/Maui.Controls.Sample.Sandbox.csproj +++ b/src/Controls/samples/Controls.Sample.Sandbox/Maui.Controls.Sample.Sandbox.csproj @@ -8,8 +8,10 @@ - .NET MAUI Controls - com.microsoft.maui.sample + .NET MAUI Controls Sandbox + com.microsoft.maui.sandbox + 5ee3361c-1cf9-443e-87f1-a7667fba9caa + 1.0 1 <_FastDeploymentDiagnosticLogging>True diff --git a/src/Controls/samples/Controls.Sample.Sandbox/Platforms/Windows/Package.appxmanifest b/src/Controls/samples/Controls.Sample.Sandbox/Platforms/Windows/Package.appxmanifest index 968c04010938..150bd01359db 100644 --- a/src/Controls/samples/Controls.Sample.Sandbox/Platforms/Windows/Package.appxmanifest +++ b/src/Controls/samples/Controls.Sample.Sandbox/Platforms/Windows/Package.appxmanifest @@ -6,10 +6,7 @@ xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap"> - + $placeholder$ diff --git a/src/Controls/samples/Controls.Sample/Pages/Core/ContextFlyoutPage.xaml b/src/Controls/samples/Controls.Sample/Pages/Core/ContextFlyoutPage.xaml new file mode 100644 index 000000000000..fcf700858c51 --- /dev/null +++ b/src/Controls/samples/Controls.Sample/Pages/Core/ContextFlyoutPage.xaml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Controls/samples/Controls.Sample/Pages/Core/ContextFlyoutPage.xaml.cs b/src/Controls/samples/Controls.Sample/Pages/Core/ContextFlyoutPage.xaml.cs new file mode 100644 index 000000000000..bb4d106da29e --- /dev/null +++ b/src/Controls/samples/Controls.Sample/Pages/Core/ContextFlyoutPage.xaml.cs @@ -0,0 +1,121 @@ +using System; +using System.Diagnostics; +using System.Windows.Input; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Graphics; + +namespace Maui.Controls.Sample.Pages +{ + public partial class ContextFlyoutPage + { + public ContextFlyoutPage() + { + InitializeComponent(); + + ImageContextCommand = new Command( + execute: async (object arg) => + { + await DisplayAlert( + title: "Image", + message: $"The image's context menu was clicked via a command with parameter: {arg}", + cancel: "OK"); + }); + + BindingContext = this; + + ContextMenuWebView.HandlerChanged += OnWebViewHandlerChanged; + } + + + void OnWebViewHandlerChanged(object sender, EventArgs e) + { + if (ContextMenuWebView.Handler != null) + { +#if WINDOWS + var webView2 = (Microsoft.UI.Xaml.Controls.WebView2)ContextMenuWebView.Handler.PlatformView; + webView2.CoreWebView2Initialized += OnWebView2CoreWebView2Initialized; +#elif MACCATALYST + var wkWebView = (WebKit.WKWebView)ContextMenuWebView.Handler.PlatformView; + // TODO: Need to figure out how to disable default WKWebView context menu so that + // the custom context flyout is shown instead. (It does sometimes show up for a second + // but then it goes back to the default web context menu.) +#endif + } + } + +#if WINDOWS + void OnWebView2CoreWebView2Initialized(Microsoft.UI.Xaml.Controls.WebView2 sender, Microsoft.UI.Xaml.Controls.CoreWebView2InitializedEventArgs args) + { + sender.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false; + } +#endif + + public ICommand ImageContextCommand { get; init; } + + int count; + + void OnIncrementByOneClicked(object sender, EventArgs e) + { + count++; + OnPropertyChanged(nameof(CounterValue)); + } + + void OnIncrementMenuItemClicked(object sender, EventArgs e) + { + var menuItem = (MenuFlyoutItem)sender; + var incrementAmount = int.Parse((string)menuItem.CommandParameter); + count += incrementAmount; + OnPropertyChanged(nameof(CounterValue)); + } + + public string CounterValue => count.ToString("N0"); + + async void OnEntryShowTextClicked(object sender, EventArgs e) + { + await DisplayAlert( + title: "Entry", + message: $"The entry's text is: {EntryWithContextFlyout.Text}", + cancel: "OK"); + } + + void OnEntryAddTextClicked(object sender, EventArgs e) + { + EntryWithContextFlyout.Text += " more text!"; + } + + void OnEntryClearTextClicked(object sender, EventArgs e) + { + EntryWithContextFlyout.Text = ""; + } + + async void OnImageContextClicked(object sender, EventArgs e) + { + await DisplayAlert( + title: "Image", + message: $"The image's context menu was clicked", + cancel: "OK"); + } + + void OnWebViewGoToSiteClicked(object sender, EventArgs e) + { + ContextMenuWebView.Source = new UrlWebViewSource() { Url = "https://github.com/dotnet/maui", }; + } + + async void OnWebViewInvokeJSClicked(object sender, EventArgs e) + { + await ContextMenuWebView.EvaluateJavaScriptAsync(@"alert('help, i\'m being invoked!');"); + } + + void OnAddMenuClicked(object sender, EventArgs e) + { + var contextFlyout = ((MenuFlyoutItem)sender).Parent as MenuFlyout; + contextFlyout.Add(new MenuFlyoutItem() { Text = "Thank you for adding me" }); + } + + void OnSubMenuClicked(object sender, EventArgs e) + { + var subMenu = ((MenuFlyoutSubItem)sender); + subMenu.Add(new MenuFlyoutItem() { Text = "Thank you for adding me" }); + } + } +} diff --git a/src/Controls/samples/Controls.Sample/ViewModels/CoreViewModel.cs b/src/Controls/samples/Controls.Sample/ViewModels/CoreViewModel.cs index abcb55c1db22..b67c0942ad64 100644 --- a/src/Controls/samples/Controls.Sample/ViewModels/CoreViewModel.cs +++ b/src/Controls/samples/Controls.Sample/ViewModels/CoreViewModel.cs @@ -24,6 +24,9 @@ protected override IEnumerable CreateItems() => new[] new SectionModel(typeof(ClipPage), "Clip", "Defines the outline of the contents of an element."), + new SectionModel(typeof(ContextFlyoutPage), "ContextFlyout", + "Right-click context menu for controls."), + new SectionModel(typeof(ContentPageGallery), "ContentPage", "Demonstrates using a Content Page."), diff --git a/src/Controls/src/Core/BindableObject.cs b/src/Controls/src/Core/BindableObject.cs index 94d4ba04dc01..e526e1f30260 100644 --- a/src/Controls/src/Core/BindableObject.cs +++ b/src/Controls/src/Core/BindableObject.cs @@ -272,6 +272,9 @@ protected virtual void OnBindingContextChanged() if (Shell.GetTitleView(this) is View titleView) SetInheritedBindingContext(titleView, BindingContext); + + if (FlyoutBase.GetContextFlyout(this) is BindableObject contextFlyout) + SetInheritedBindingContext(contextFlyout, BindingContext); } protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/Windows/CellControl.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/Windows/CellControl.cs index 1dc0ece2f8e8..513a220da4a6 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/ListView/Windows/CellControl.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/Windows/CellControl.cs @@ -15,6 +15,8 @@ using WSolidColorBrush = Microsoft.UI.Xaml.Media.SolidColorBrush; using Microsoft.Maui.Controls.Handlers.Compatibility; using Windows.Foundation; +using WMenuFlyout = Microsoft.UI.Xaml.Controls.MenuFlyout; +using WFlyoutBase = Microsoft.UI.Xaml.Controls.Primitives.FlyoutBase; namespace Microsoft.Maui.Controls.Platform.Compatibility { @@ -281,9 +283,9 @@ private void OnCellContentRightTapped(object sender, RightTappedRoutedEventArgs /// /// To check the context, not just the text. /// - MenuFlyout GetAttachedFlyout() + WMenuFlyout GetAttachedFlyout() { - if (FlyoutBase.GetAttachedFlyout(CellContent) is MenuFlyout flyout) + if (WFlyoutBase.GetAttachedFlyout(CellContent) is WMenuFlyout flyout) { var actions = Cell.ContextActions; if (flyout.Items.Count != actions.Count) @@ -303,16 +305,16 @@ void OpenContextMenu(Point point) { if (GetAttachedFlyout() == null) { - var flyout = new MenuFlyout(); + var flyout = new WMenuFlyout(); SetupMenuItems(flyout); ((INotifyCollectionChanged)Cell.ContextActions).CollectionChanged += OnContextActionsChanged; _contextActions = Cell.ContextActions; - FlyoutBase.SetAttachedFlyout(CellContent, flyout); + WFlyoutBase.SetAttachedFlyout(CellContent, flyout); } - FlyoutBase + WFlyoutBase .GetAttachedFlyout(CellContent) .ShowAt( CellContent, @@ -444,14 +446,14 @@ void SetupContextMenu() _contextActions = null; } - FlyoutBase.SetAttachedFlyout(CellContent, null); + WFlyoutBase.SetAttachedFlyout(CellContent, null); return; } CellContent.RightTapped += OnCellContentRightTapped; } - void SetupMenuItems(MenuFlyout flyout) + void SetupMenuItems(WMenuFlyout flyout) { foreach (MenuItem item in Cell.ContextActions) { diff --git a/src/Controls/src/Core/ContextFlyout.cs b/src/Controls/src/Core/ContextFlyout.cs new file mode 100644 index 000000000000..9a7e6e2c427c --- /dev/null +++ b/src/Controls/src/Core/ContextFlyout.cs @@ -0,0 +1,120 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace Microsoft.Maui.Controls +{ + + public partial class MenuFlyout : FlyoutBase, IMenuFlyout // Same pattern as MenuBarItem + { + ReadOnlyCastingList _logicalChildren; + readonly ObservableCollection _menus = new ObservableCollection(); + + internal override IReadOnlyList LogicalChildrenInternal => + _logicalChildren ??= new ReadOnlyCastingList(_menus); + + public IMenuElement this[int index] + { + get { return _menus[index]; } + set + { + RemoveAt(index); + Insert(index, value); + } + } + + public int Count => _menus.Count; + + public bool IsReadOnly => false; + + public void Add(IMenuElement item) + { + var index = _menus.Count; + _menus.Add(item); + NotifyHandler(nameof(IMenuFlyoutHandler.Add), index, item); + + // Take care of the Element internal bookkeeping + if (item is Element element) + { + OnChildAdded(element); + } + } + + public void Clear() + { + for (int i = _menus.Count - 1; i >= 0; i--) + RemoveAt(i); + } + + public bool Contains(IMenuElement item) + { + return _menus.Contains(item); + } + + public void CopyTo(IMenuElement[] array, int arrayIndex) + { + _menus.CopyTo(array, arrayIndex); + } + + public IEnumerator GetEnumerator() + { + return _menus.GetEnumerator(); + } + + public int IndexOf(IMenuElement item) + { + return _menus.IndexOf(item); + } + + public void Insert(int index, IMenuElement item) + { + _menus.Insert(index, item); + NotifyHandler(nameof(IMenuFlyoutHandler.Insert), index, item); + + // Take care of the Element internal bookkeeping + if (item is Element element) + { + OnChildAdded(element); + } + } + + public bool Remove(IMenuElement item) + { + var index = _menus.IndexOf(item); + var result = _menus.Remove(item); + NotifyHandler(nameof(IMenuFlyoutHandler.Remove), index, item); + + // Take care of the Element internal bookkeeping + if (item is Element element) + { + OnChildRemoved(element, index); + } + + return result; + } + + public void RemoveAt(int index) + { + var item = _menus[index]; + _menus.RemoveAt(index); + NotifyHandler(nameof(IMenuFlyoutHandler.Remove), index, item); + + // Take care of the Element internal bookkeeping + if (item is Element element) + { + OnChildRemoved(element, index); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return _menus.GetEnumerator(); + } + + void NotifyHandler(string action, int index, IMenuElement view) + { + Handler?.Invoke(action, new Maui.Handlers.ContextFlyoutItemHandlerUpdate(index, view)); + } + } +} diff --git a/src/Controls/src/Core/FlyoutBase.cs b/src/Controls/src/Core/FlyoutBase.cs new file mode 100644 index 000000000000..761ab4579721 --- /dev/null +++ b/src/Controls/src/Core/FlyoutBase.cs @@ -0,0 +1,26 @@ +namespace Microsoft.Maui.Controls +{ + public abstract class FlyoutBase : Element, IFlyout + { + public static readonly BindableProperty ContextFlyoutProperty = BindableProperty.CreateAttached("ContextFlyout", typeof(FlyoutBase), typeof(FlyoutBase), null, + propertyChanged: (bo, oldV, newV) => + { + if (oldV is BindableObject oldMenu) + VisualElement.SetInheritedBindingContext(oldMenu, null); + + if (newV is BindableObject newMenu) + VisualElement.SetInheritedBindingContext(newMenu, bo.BindingContext); + + }); + + public static void SetContextFlyout(BindableObject b, FlyoutBase value) + { + b.SetValue(ContextFlyoutProperty, value); + } + + public static FlyoutBase GetContextFlyout(BindableObject b) + { + return (FlyoutBase)b.GetValue(ContextFlyoutProperty); + } + } +} diff --git a/src/Controls/src/Core/HandlerImpl/Element/Element.Impl.cs b/src/Controls/src/Core/HandlerImpl/Element/Element.Impl.cs index 65e3d48e6596..72543e3bca9e 100644 --- a/src/Controls/src/Core/HandlerImpl/Element/Element.Impl.cs +++ b/src/Controls/src/Core/HandlerImpl/Element/Element.Impl.cs @@ -5,7 +5,7 @@ namespace Microsoft.Maui.Controls { /// - public partial class Element : Maui.IElement, IEffectControlProvider, IToolTipElement + public partial class Element : Maui.IElement, IEffectControlProvider, IToolTipElement, IContextFlyoutElement { IElementHandler _handler; EffectsFactory _effectsFactory; @@ -100,5 +100,6 @@ void IEffectControlProvider.RegisterEffect(Effect effect) } ToolTip IToolTipElement.ToolTip => ToolTipProperties.GetToolTip(this); + IFlyout IContextFlyoutElement.ContextFlyout => FlyoutBase.GetContextFlyout(this); } } diff --git a/src/Controls/src/Core/Layout/Layout.cs b/src/Controls/src/Core/Layout/Layout.cs index 97c5876e7b5f..c88f0dbaf38a 100644 --- a/src/Controls/src/Core/Layout/Layout.cs +++ b/src/Controls/src/Core/Layout/Layout.cs @@ -261,8 +261,7 @@ protected virtual void OnUpdate(int index, IView view, IView oldView) void NotifyHandler(string action, int index, IView view) { - var args = new Maui.Handlers.LayoutHandlerUpdate(index, view); - Handler?.Invoke(action, args); + Handler?.Invoke(action, new Maui.Handlers.LayoutHandlerUpdate(index, view)); } void IPaddingElement.OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue) diff --git a/src/Controls/src/Core/MenuBar.cs b/src/Controls/src/Core/MenuBar.cs index 840a33417f72..c326e2cc0cf8 100644 --- a/src/Controls/src/Core/MenuBar.cs +++ b/src/Controls/src/Core/MenuBar.cs @@ -133,8 +133,7 @@ IEnumerator IEnumerable.GetEnumerator() void NotifyHandler(string action, int index, IMenuBarItem view) { - var args = new Maui.Handlers.MenuBarHandlerUpdate(index, view); - Handler?.Invoke(action, args); + Handler?.Invoke(action, new Maui.Handlers.MenuBarHandlerUpdate(index, view)); } } } \ No newline at end of file diff --git a/src/Controls/src/Core/MenuBarItem.cs b/src/Controls/src/Core/MenuBarItem.cs index 999660bc7818..ab97f855a17f 100644 --- a/src/Controls/src/Core/MenuBarItem.cs +++ b/src/Controls/src/Core/MenuBarItem.cs @@ -140,8 +140,7 @@ IEnumerator IEnumerable.GetEnumerator() void NotifyHandler(string action, int index, IMenuElement view) { - var args = new Maui.Handlers.MenuBarItemHandlerUpdate(index, view); - Handler?.Invoke(action, args); + Handler?.Invoke(action, new Maui.Handlers.MenuBarItemHandlerUpdate(index, view)); } } } \ No newline at end of file diff --git a/src/Controls/src/Core/MenuFlyoutSubItem.cs b/src/Controls/src/Core/MenuFlyoutSubItem.cs index 5ffe8a98b000..e8bda7696877 100644 --- a/src/Controls/src/Core/MenuFlyoutSubItem.cs +++ b/src/Controls/src/Core/MenuFlyoutSubItem.cs @@ -117,8 +117,7 @@ IEnumerator IEnumerable.GetEnumerator() void NotifyHandler(string action, int index, IMenuElement view) { - var args = new Maui.Handlers.MenuFlyoutSubItemHandlerUpdate(index, view); - Handler?.Invoke(action, args); + Handler?.Invoke(action, new Maui.Handlers.MenuFlyoutSubItemHandlerUpdate(index, view)); } } } \ No newline at end of file diff --git a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt index a509317dc834..1127aa3bb1a9 100644 --- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1,4 +1,12 @@ #nullable enable +Microsoft.Maui.Controls.FlyoutBase +Microsoft.Maui.Controls.FlyoutBase.FlyoutBase() -> void +Microsoft.Maui.Controls.MenuFlyout +Microsoft.Maui.Controls.MenuFlyout.Clear() -> void +Microsoft.Maui.Controls.MenuFlyout.MenuFlyout() -> void +Microsoft.Maui.Controls.MenuFlyout.Count.get -> int +Microsoft.Maui.Controls.MenuFlyout.IsReadOnly.get -> bool +Microsoft.Maui.Controls.MenuFlyout.RemoveAt(int index) -> void Microsoft.Maui.Controls.MenuFlyoutSeparator Microsoft.Maui.Controls.MenuFlyoutSeparator.MenuFlyoutSeparator() -> void Microsoft.Maui.Controls.ToolTipProperties @@ -14,6 +22,15 @@ override Microsoft.Maui.Controls.TemplatedView.MeasureOverride(double widthConst static Microsoft.Maui.Controls.ToolTipProperties.GetText(Microsoft.Maui.Controls.BindableObject! bindable) -> object! static Microsoft.Maui.Controls.ToolTipProperties.SetText(Microsoft.Maui.Controls.BindableObject! bindable, object! value) -> void static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Microsoft.Maui.Controls.BindableProperty! +~Microsoft.Maui.Controls.MenuFlyout.Add(Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Contains(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.CopyTo(Microsoft.Maui.IMenuElement[] array, int arrayIndex) -> void +~Microsoft.Maui.Controls.MenuFlyout.GetEnumerator() -> System.Collections.Generic.IEnumerator +~Microsoft.Maui.Controls.MenuFlyout.IndexOf(Microsoft.Maui.IMenuElement item) -> int +~Microsoft.Maui.Controls.MenuFlyout.Insert(int index, Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Remove(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.this[int index].get -> Microsoft.Maui.IMenuElement +~Microsoft.Maui.Controls.MenuFlyout.this[int index].set -> void ~override Microsoft.Maui.Controls.Handlers.Compatibility.ViewCellRenderer.DisconnectHandler(Android.Views.View platformView) -> void *REMOVED*override Microsoft.Maui.Controls.ContentView.ArrangeOverride(Microsoft.Maui.Graphics.Rect bounds) -> Microsoft.Maui.Graphics.Size *REMOVED*override Microsoft.Maui.Controls.ContentView.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size @@ -22,3 +39,6 @@ static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Micros *REMOVED*override Microsoft.Maui.Controls.FlexLayout.MeasureOverride(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsoft.Maui.Controls.BindableProperty! *REMOVED*override Microsoft.Maui.Controls.Platform.ControlsAccessibilityDelegate.OnInitializeAccessibilityNodeInfo(Android.Views.View? host, AndroidX.Core.View.Accessibility.AccessibilityNodeInfoCompat? info) -> void +~static Microsoft.Maui.Controls.FlyoutBase.GetContextFlyout(Microsoft.Maui.Controls.BindableObject b) -> Microsoft.Maui.Controls.FlyoutBase +~static Microsoft.Maui.Controls.FlyoutBase.SetContextFlyout(Microsoft.Maui.Controls.BindableObject b, Microsoft.Maui.Controls.FlyoutBase value) -> void +~static readonly Microsoft.Maui.Controls.FlyoutBase.ContextFlyoutProperty -> Microsoft.Maui.Controls.BindableProperty diff --git a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt index 082757d294a7..e7b40843b15f 100644 --- a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -1,4 +1,12 @@ #nullable enable +Microsoft.Maui.Controls.FlyoutBase +Microsoft.Maui.Controls.FlyoutBase.FlyoutBase() -> void +Microsoft.Maui.Controls.MenuFlyout +Microsoft.Maui.Controls.MenuFlyout.Clear() -> void +Microsoft.Maui.Controls.MenuFlyout.MenuFlyout() -> void +Microsoft.Maui.Controls.MenuFlyout.Count.get -> int +Microsoft.Maui.Controls.MenuFlyout.IsReadOnly.get -> bool +Microsoft.Maui.Controls.MenuFlyout.RemoveAt(int index) -> void Microsoft.Maui.Controls.MenuFlyoutSeparator Microsoft.Maui.Controls.MenuFlyoutSeparator.MenuFlyoutSeparator() -> void Microsoft.Maui.Controls.ToolTipProperties @@ -19,3 +27,15 @@ static Microsoft.Maui.Controls.ToolTipProperties.GetText(Microsoft.Maui.Controls static Microsoft.Maui.Controls.ToolTipProperties.SetText(Microsoft.Maui.Controls.BindableObject! bindable, object! value) -> void static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsoft.Maui.Controls.BindableProperty! +~Microsoft.Maui.Controls.MenuFlyout.Add(Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Contains(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.CopyTo(Microsoft.Maui.IMenuElement[] array, int arrayIndex) -> void +~Microsoft.Maui.Controls.MenuFlyout.GetEnumerator() -> System.Collections.Generic.IEnumerator +~Microsoft.Maui.Controls.MenuFlyout.IndexOf(Microsoft.Maui.IMenuElement item) -> int +~Microsoft.Maui.Controls.MenuFlyout.Insert(int index, Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Remove(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.this[int index].get -> Microsoft.Maui.IMenuElement +~Microsoft.Maui.Controls.MenuFlyout.this[int index].set -> void +~static Microsoft.Maui.Controls.FlyoutBase.GetContextFlyout(Microsoft.Maui.Controls.BindableObject b) -> Microsoft.Maui.Controls.FlyoutBase +~static Microsoft.Maui.Controls.FlyoutBase.SetContextFlyout(Microsoft.Maui.Controls.BindableObject b, Microsoft.Maui.Controls.FlyoutBase value) -> void +~static readonly Microsoft.Maui.Controls.FlyoutBase.ContextFlyoutProperty -> Microsoft.Maui.Controls.BindableProperty diff --git a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index 082757d294a7..e7b40843b15f 100644 --- a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -1,4 +1,12 @@ #nullable enable +Microsoft.Maui.Controls.FlyoutBase +Microsoft.Maui.Controls.FlyoutBase.FlyoutBase() -> void +Microsoft.Maui.Controls.MenuFlyout +Microsoft.Maui.Controls.MenuFlyout.Clear() -> void +Microsoft.Maui.Controls.MenuFlyout.MenuFlyout() -> void +Microsoft.Maui.Controls.MenuFlyout.Count.get -> int +Microsoft.Maui.Controls.MenuFlyout.IsReadOnly.get -> bool +Microsoft.Maui.Controls.MenuFlyout.RemoveAt(int index) -> void Microsoft.Maui.Controls.MenuFlyoutSeparator Microsoft.Maui.Controls.MenuFlyoutSeparator.MenuFlyoutSeparator() -> void Microsoft.Maui.Controls.ToolTipProperties @@ -19,3 +27,15 @@ static Microsoft.Maui.Controls.ToolTipProperties.GetText(Microsoft.Maui.Controls static Microsoft.Maui.Controls.ToolTipProperties.SetText(Microsoft.Maui.Controls.BindableObject! bindable, object! value) -> void static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsoft.Maui.Controls.BindableProperty! +~Microsoft.Maui.Controls.MenuFlyout.Add(Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Contains(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.CopyTo(Microsoft.Maui.IMenuElement[] array, int arrayIndex) -> void +~Microsoft.Maui.Controls.MenuFlyout.GetEnumerator() -> System.Collections.Generic.IEnumerator +~Microsoft.Maui.Controls.MenuFlyout.IndexOf(Microsoft.Maui.IMenuElement item) -> int +~Microsoft.Maui.Controls.MenuFlyout.Insert(int index, Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Remove(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.this[int index].get -> Microsoft.Maui.IMenuElement +~Microsoft.Maui.Controls.MenuFlyout.this[int index].set -> void +~static Microsoft.Maui.Controls.FlyoutBase.GetContextFlyout(Microsoft.Maui.Controls.BindableObject b) -> Microsoft.Maui.Controls.FlyoutBase +~static Microsoft.Maui.Controls.FlyoutBase.SetContextFlyout(Microsoft.Maui.Controls.BindableObject b, Microsoft.Maui.Controls.FlyoutBase value) -> void +~static readonly Microsoft.Maui.Controls.FlyoutBase.ContextFlyoutProperty -> Microsoft.Maui.Controls.BindableProperty diff --git a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 2a362b76050d..bf213f85eacb 100644 --- a/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -1,4 +1,12 @@ #nullable enable +Microsoft.Maui.Controls.FlyoutBase +Microsoft.Maui.Controls.FlyoutBase.FlyoutBase() -> void +Microsoft.Maui.Controls.MenuFlyout +Microsoft.Maui.Controls.MenuFlyout.Clear() -> void +Microsoft.Maui.Controls.MenuFlyout.MenuFlyout() -> void +Microsoft.Maui.Controls.MenuFlyout.Count.get -> int +Microsoft.Maui.Controls.MenuFlyout.IsReadOnly.get -> bool +Microsoft.Maui.Controls.MenuFlyout.RemoveAt(int index) -> void Microsoft.Maui.Controls.MenuFlyoutSeparator Microsoft.Maui.Controls.MenuFlyoutSeparator.MenuFlyoutSeparator() -> void Microsoft.Maui.Controls.ToolTipProperties @@ -17,4 +25,16 @@ override Microsoft.Maui.Controls.TemplatedView.MeasureOverride(double widthConst static Microsoft.Maui.Controls.ToolTipProperties.GetText(Microsoft.Maui.Controls.BindableObject! bindable) -> object! static Microsoft.Maui.Controls.ToolTipProperties.SetText(Microsoft.Maui.Controls.BindableObject! bindable, object! value) -> void static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Microsoft.Maui.Controls.BindableProperty! -static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsoft.Maui.Controls.BindableProperty! \ No newline at end of file +static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsoft.Maui.Controls.BindableProperty! +~Microsoft.Maui.Controls.MenuFlyout.Add(Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Contains(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.CopyTo(Microsoft.Maui.IMenuElement[] array, int arrayIndex) -> void +~Microsoft.Maui.Controls.MenuFlyout.GetEnumerator() -> System.Collections.Generic.IEnumerator +~Microsoft.Maui.Controls.MenuFlyout.IndexOf(Microsoft.Maui.IMenuElement item) -> int +~Microsoft.Maui.Controls.MenuFlyout.Insert(int index, Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Remove(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.this[int index].get -> Microsoft.Maui.IMenuElement +~Microsoft.Maui.Controls.MenuFlyout.this[int index].set -> void +~static Microsoft.Maui.Controls.FlyoutBase.GetContextFlyout(Microsoft.Maui.Controls.BindableObject b) -> Microsoft.Maui.Controls.FlyoutBase +~static Microsoft.Maui.Controls.FlyoutBase.SetContextFlyout(Microsoft.Maui.Controls.BindableObject b, Microsoft.Maui.Controls.FlyoutBase value) -> void +~static readonly Microsoft.Maui.Controls.FlyoutBase.ContextFlyoutProperty -> Microsoft.Maui.Controls.BindableProperty diff --git a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt index 4724b14b146b..f30d626778e8 100644 --- a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -1,4 +1,12 @@ #nullable enable +Microsoft.Maui.Controls.FlyoutBase +Microsoft.Maui.Controls.FlyoutBase.FlyoutBase() -> void +Microsoft.Maui.Controls.MenuFlyout +Microsoft.Maui.Controls.MenuFlyout.Clear() -> void +Microsoft.Maui.Controls.MenuFlyout.MenuFlyout() -> void +Microsoft.Maui.Controls.MenuFlyout.Count.get -> int +Microsoft.Maui.Controls.MenuFlyout.IsReadOnly.get -> bool +Microsoft.Maui.Controls.MenuFlyout.RemoveAt(int index) -> void Microsoft.Maui.Controls.Platform.ShellNavigationViewItem Microsoft.Maui.Controls.Platform.ShellNavigationViewItem.ShellNavigationViewItem() -> void Microsoft.Maui.Controls.Platform.ShellNavigationViewItemAutomationPeer @@ -25,4 +33,16 @@ override Microsoft.Maui.Controls.TemplatedView.MeasureOverride(double widthConst static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsoft.Maui.Controls.BindableProperty! static Microsoft.Maui.Controls.ToolTipProperties.GetText(Microsoft.Maui.Controls.BindableObject! bindable) -> object! static Microsoft.Maui.Controls.ToolTipProperties.SetText(Microsoft.Maui.Controls.BindableObject! bindable, object! value) -> void -static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Microsoft.Maui.Controls.BindableProperty! \ No newline at end of file +static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Microsoft.Maui.Controls.BindableProperty! +~Microsoft.Maui.Controls.MenuFlyout.Add(Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Contains(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.CopyTo(Microsoft.Maui.IMenuElement[] array, int arrayIndex) -> void +~Microsoft.Maui.Controls.MenuFlyout.GetEnumerator() -> System.Collections.Generic.IEnumerator +~Microsoft.Maui.Controls.MenuFlyout.IndexOf(Microsoft.Maui.IMenuElement item) -> int +~Microsoft.Maui.Controls.MenuFlyout.Insert(int index, Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Remove(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.this[int index].get -> Microsoft.Maui.IMenuElement +~Microsoft.Maui.Controls.MenuFlyout.this[int index].set -> void +~static Microsoft.Maui.Controls.FlyoutBase.GetContextFlyout(Microsoft.Maui.Controls.BindableObject b) -> Microsoft.Maui.Controls.FlyoutBase +~static Microsoft.Maui.Controls.FlyoutBase.SetContextFlyout(Microsoft.Maui.Controls.BindableObject b, Microsoft.Maui.Controls.FlyoutBase value) -> void +~static readonly Microsoft.Maui.Controls.FlyoutBase.ContextFlyoutProperty -> Microsoft.Maui.Controls.BindableProperty diff --git a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt index 510c8e686fce..bf213f85eacb 100644 --- a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt @@ -1,4 +1,12 @@ #nullable enable +Microsoft.Maui.Controls.FlyoutBase +Microsoft.Maui.Controls.FlyoutBase.FlyoutBase() -> void +Microsoft.Maui.Controls.MenuFlyout +Microsoft.Maui.Controls.MenuFlyout.Clear() -> void +Microsoft.Maui.Controls.MenuFlyout.MenuFlyout() -> void +Microsoft.Maui.Controls.MenuFlyout.Count.get -> int +Microsoft.Maui.Controls.MenuFlyout.IsReadOnly.get -> bool +Microsoft.Maui.Controls.MenuFlyout.RemoveAt(int index) -> void Microsoft.Maui.Controls.MenuFlyoutSeparator Microsoft.Maui.Controls.MenuFlyoutSeparator.MenuFlyoutSeparator() -> void Microsoft.Maui.Controls.ToolTipProperties @@ -18,3 +26,15 @@ static Microsoft.Maui.Controls.ToolTipProperties.GetText(Microsoft.Maui.Controls static Microsoft.Maui.Controls.ToolTipProperties.SetText(Microsoft.Maui.Controls.BindableObject! bindable, object! value) -> void static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Microsoft.Maui.Controls.BindableProperty! static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsoft.Maui.Controls.BindableProperty! +~Microsoft.Maui.Controls.MenuFlyout.Add(Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Contains(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.CopyTo(Microsoft.Maui.IMenuElement[] array, int arrayIndex) -> void +~Microsoft.Maui.Controls.MenuFlyout.GetEnumerator() -> System.Collections.Generic.IEnumerator +~Microsoft.Maui.Controls.MenuFlyout.IndexOf(Microsoft.Maui.IMenuElement item) -> int +~Microsoft.Maui.Controls.MenuFlyout.Insert(int index, Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Remove(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.this[int index].get -> Microsoft.Maui.IMenuElement +~Microsoft.Maui.Controls.MenuFlyout.this[int index].set -> void +~static Microsoft.Maui.Controls.FlyoutBase.GetContextFlyout(Microsoft.Maui.Controls.BindableObject b) -> Microsoft.Maui.Controls.FlyoutBase +~static Microsoft.Maui.Controls.FlyoutBase.SetContextFlyout(Microsoft.Maui.Controls.BindableObject b, Microsoft.Maui.Controls.FlyoutBase value) -> void +~static readonly Microsoft.Maui.Controls.FlyoutBase.ContextFlyoutProperty -> Microsoft.Maui.Controls.BindableProperty diff --git a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt index 2a362b76050d..bf213f85eacb 100644 --- a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -1,4 +1,12 @@ #nullable enable +Microsoft.Maui.Controls.FlyoutBase +Microsoft.Maui.Controls.FlyoutBase.FlyoutBase() -> void +Microsoft.Maui.Controls.MenuFlyout +Microsoft.Maui.Controls.MenuFlyout.Clear() -> void +Microsoft.Maui.Controls.MenuFlyout.MenuFlyout() -> void +Microsoft.Maui.Controls.MenuFlyout.Count.get -> int +Microsoft.Maui.Controls.MenuFlyout.IsReadOnly.get -> bool +Microsoft.Maui.Controls.MenuFlyout.RemoveAt(int index) -> void Microsoft.Maui.Controls.MenuFlyoutSeparator Microsoft.Maui.Controls.MenuFlyoutSeparator.MenuFlyoutSeparator() -> void Microsoft.Maui.Controls.ToolTipProperties @@ -17,4 +25,16 @@ override Microsoft.Maui.Controls.TemplatedView.MeasureOverride(double widthConst static Microsoft.Maui.Controls.ToolTipProperties.GetText(Microsoft.Maui.Controls.BindableObject! bindable) -> object! static Microsoft.Maui.Controls.ToolTipProperties.SetText(Microsoft.Maui.Controls.BindableObject! bindable, object! value) -> void static readonly Microsoft.Maui.Controls.ToolTipProperties.TextProperty -> Microsoft.Maui.Controls.BindableProperty! -static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsoft.Maui.Controls.BindableProperty! \ No newline at end of file +static readonly Microsoft.Maui.Controls.VisualElement.ZIndexProperty -> Microsoft.Maui.Controls.BindableProperty! +~Microsoft.Maui.Controls.MenuFlyout.Add(Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Contains(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.CopyTo(Microsoft.Maui.IMenuElement[] array, int arrayIndex) -> void +~Microsoft.Maui.Controls.MenuFlyout.GetEnumerator() -> System.Collections.Generic.IEnumerator +~Microsoft.Maui.Controls.MenuFlyout.IndexOf(Microsoft.Maui.IMenuElement item) -> int +~Microsoft.Maui.Controls.MenuFlyout.Insert(int index, Microsoft.Maui.IMenuElement item) -> void +~Microsoft.Maui.Controls.MenuFlyout.Remove(Microsoft.Maui.IMenuElement item) -> bool +~Microsoft.Maui.Controls.MenuFlyout.this[int index].get -> Microsoft.Maui.IMenuElement +~Microsoft.Maui.Controls.MenuFlyout.this[int index].set -> void +~static Microsoft.Maui.Controls.FlyoutBase.GetContextFlyout(Microsoft.Maui.Controls.BindableObject b) -> Microsoft.Maui.Controls.FlyoutBase +~static Microsoft.Maui.Controls.FlyoutBase.SetContextFlyout(Microsoft.Maui.Controls.BindableObject b, Microsoft.Maui.Controls.FlyoutBase value) -> void +~static readonly Microsoft.Maui.Controls.FlyoutBase.ContextFlyoutProperty -> Microsoft.Maui.Controls.BindableProperty diff --git a/src/Controls/src/Core/Shell/Shell.cs b/src/Controls/src/Core/Shell/Shell.cs index 726e09275ac5..23dee2f67b72 100644 --- a/src/Controls/src/Core/Shell/Shell.cs +++ b/src/Controls/src/Core/Shell/Shell.cs @@ -619,6 +619,7 @@ bool IShellController.RemoveAppearanceObserver(IAppearanceObserver observer) return true; } } + return false; } diff --git a/src/Controls/src/Core/View.cs b/src/Controls/src/Core/View.cs index 831feb5e9f8d..394fbad678c2 100644 --- a/src/Controls/src/Core/View.cs +++ b/src/Controls/src/Core/View.cs @@ -3,6 +3,7 @@ using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Linq; +using Microsoft.Maui; using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Graphics; diff --git a/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs b/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs index e14c54f8fa6b..6e777343b916 100644 --- a/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs +++ b/src/Controls/src/Xaml/Hosting/AppHostBuilderExtensions.cs @@ -109,6 +109,10 @@ public static IMauiHandlersCollection AddMauiControlsHandlers(this IMauiHandlers handlersCollection.AddHandler(typeof(Frame), typeof(Handlers.Compatibility.FrameRenderer)); #endif +#if WINDOWS || MACCATALYST + handlersCollection.AddHandler(typeof(MenuFlyout), typeof(MenuFlyoutHandler)); +#endif + #if IOS || MACCATALYST handlersCollection.AddHandler(typeof(NavigationPage), typeof(Handlers.Compatibility.NavigationRenderer)); handlersCollection.AddHandler(typeof(TabbedPage), typeof(Handlers.Compatibility.TabbedRenderer)); @@ -136,7 +140,7 @@ public static IMauiHandlersCollection AddMauiControlsHandlers(this IMauiHandlers handlersCollection.AddHandler(); handlersCollection.AddHandler(); #endif - return handlersCollection; + return handlersCollection; } static MauiAppBuilder SetupDefaults(this MauiAppBuilder builder) diff --git a/src/Controls/tests/Core.UnitTests/Menu/ContextFlyoutTests.cs b/src/Controls/tests/Core.UnitTests/Menu/ContextFlyoutTests.cs new file mode 100644 index 000000000000..98a418c08675 --- /dev/null +++ b/src/Controls/tests/Core.UnitTests/Menu/ContextFlyoutTests.cs @@ -0,0 +1,106 @@ +#nullable enable +using System; +using System.Collections.Generic; +using Microsoft.Maui.Handlers; +using Xunit; + +namespace Microsoft.Maui.Controls.Core.UnitTests.Menu +{ + [Category("MenuFlyout")] + public class ContextFlyoutTests : + MenuTestBase + { + [Fact] + public void BindingContextPropagatesWhenContextFlyoutIsAlreadySetOnParent() + { + Button button = new Button(); + var subMenuFlyout = new MenuFlyoutSubItem(); + var menuFlyoutItem = new MenuFlyoutItem(); + var menuFlyout = new MenuFlyout(); + menuFlyout.Add(subMenuFlyout); + subMenuFlyout.Add(menuFlyoutItem); + + FlyoutBase.SetContextFlyout(button, menuFlyout); + + var bc = new Object(); + button.BindingContext = bc; + + Assert.Same(bc, subMenuFlyout.BindingContext); + Assert.Same(bc, menuFlyout.BindingContext); + } + + [Fact] + public void BindingContextPropagatesWhenContextFlyoutIsSetAfterParentBindingContextIsSet() + { + Button button = new Button(); + var subMenuFlyout = new MenuFlyoutSubItem(); + var menuFlyoutItem = new MenuFlyoutItem(); + subMenuFlyout.Add(menuFlyoutItem); + + var bc = new Object(); + button.BindingContext = bc; + var menuFlyout = new MenuFlyout(); + menuFlyout.Add(subMenuFlyout); + FlyoutBase.SetContextFlyout(button, menuFlyout); + + Assert.Same(bc, subMenuFlyout.BindingContext); + Assert.Same(bc, menuFlyout.BindingContext); + } + + [Fact] + public void BindingContextPropagatesToAddedFlyoutItems() + { + Button button = new Button(); + var subMenuFlyout = new MenuFlyoutSubItem(); + var menuFlyoutItem = new MenuFlyoutItem(); + + var bc = new Object(); + button.BindingContext = bc; + var menuFlyout = new MenuFlyout(); + menuFlyout.Add(subMenuFlyout); + FlyoutBase.SetContextFlyout(button, menuFlyout); + + // Add submenu after MenuFlyout is already set on Button + subMenuFlyout.Add(menuFlyoutItem); + + Assert.Same(bc, subMenuFlyout.BindingContext); + Assert.Same(bc, menuFlyoutItem.BindingContext); + } + + protected override int GetIndex(ContextFlyoutItemHandlerUpdate handlerUpdate) + => handlerUpdate.Index; + + protected override IMenuElement GetItem(ContextFlyoutItemHandlerUpdate handlerUpdate) => + handlerUpdate.MenuElement; + + protected override void SetHandler(IElement element, List<(string Name, ContextFlyoutItemHandlerUpdate? Args)> events) + { + element.Handler = CreateMenuFlyoutHandler((n, h, l, a) => events.Add((n, a))); + } + + MenuFlyoutHandler CreateMenuFlyoutHandler(Action? action) + { + var handler = new NonThrowingMenuFlyoutHandler( + MenuFlyoutHandler.Mapper, + new CommandMapper(MenuFlyoutHandler.CommandMapper) + { + [nameof(IMenuFlyoutHandler.Add)] = (h, l, a) => action?.Invoke(nameof(IMenuFlyoutHandler.Add), h, l, (ContextFlyoutItemHandlerUpdate?)a), + [nameof(IMenuFlyoutHandler.Remove)] = (h, l, a) => action?.Invoke(nameof(IMenuFlyoutHandler.Remove), h, l, (ContextFlyoutItemHandlerUpdate?)a), + [nameof(IMenuFlyoutHandler.Clear)] = (h, l, a) => action?.Invoke(nameof(IMenuFlyoutHandler.Clear), h, l, (ContextFlyoutItemHandlerUpdate?)a), + [nameof(IMenuFlyoutHandler.Insert)] = (h, l, a) => action?.Invoke(nameof(IMenuFlyoutHandler.Insert), h, l, (ContextFlyoutItemHandlerUpdate?)a), + }); + + return handler; + } + + class NonThrowingMenuFlyoutHandler : MenuFlyoutHandler + { + public NonThrowingMenuFlyoutHandler(IPropertyMapper mapper, CommandMapper commandMapper) + : base(mapper, commandMapper) + { + } + + protected override object CreatePlatformElement() => new object(); + } + } +} diff --git a/src/Controls/tests/Core.UnitTests/Menu/MenuBarItemTests.cs b/src/Controls/tests/Core.UnitTests/Menu/MenuBarItemTests.cs index 15cead251cb1..cbcc945ef394 100644 --- a/src/Controls/tests/Core.UnitTests/Menu/MenuBarItemTests.cs +++ b/src/Controls/tests/Core.UnitTests/Menu/MenuBarItemTests.cs @@ -8,7 +8,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests.Menu { [Category("MenuBarItem")] public class MenuBarItemTests : - MenuBarTestBase + MenuTestBase { protected override int GetIndex(MenuBarItemHandlerUpdate handlerUpdate) => handlerUpdate.Index; diff --git a/src/Controls/tests/Core.UnitTests/Menu/MenuBarTests.cs b/src/Controls/tests/Core.UnitTests/Menu/MenuBarTests.cs index 740fb65cf229..e9ed9f4a1859 100644 --- a/src/Controls/tests/Core.UnitTests/Menu/MenuBarTests.cs +++ b/src/Controls/tests/Core.UnitTests/Menu/MenuBarTests.cs @@ -8,7 +8,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests.Menu { [Category("MenuBar")] public class MenuBarTests : - MenuBarTestBase + MenuTestBase { protected override int GetIndex(MenuBarHandlerUpdate handlerUpdate) => handlerUpdate.Index; diff --git a/src/Controls/tests/Core.UnitTests/Menu/MenuBarTrackerTests.cs b/src/Controls/tests/Core.UnitTests/Menu/MenuBarTrackerTests.cs index 124e5472c1d5..27a618d85eff 100644 --- a/src/Controls/tests/Core.UnitTests/Menu/MenuBarTrackerTests.cs +++ b/src/Controls/tests/Core.UnitTests/Menu/MenuBarTrackerTests.cs @@ -5,7 +5,6 @@ namespace Microsoft.Maui.Controls.Core.UnitTests.MenuBarTests { - public class MenuBarTrackerTests : BaseTestFixture { [Fact] diff --git a/src/Controls/tests/Core.UnitTests/Menu/MenuFlyoutSubItemTests.cs b/src/Controls/tests/Core.UnitTests/Menu/MenuFlyoutSubItemTests.cs index 4ca3287f7b51..6774eb4e7988 100644 --- a/src/Controls/tests/Core.UnitTests/Menu/MenuFlyoutSubItemTests.cs +++ b/src/Controls/tests/Core.UnitTests/Menu/MenuFlyoutSubItemTests.cs @@ -8,7 +8,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests.Menu { [Category("MenuFlyoutSubItem")] public class MenuFlyoutSubItemTests : - MenuBarTestBase + MenuTestBase { protected override int GetIndex(MenuFlyoutSubItemHandlerUpdate handlerUpdate) => handlerUpdate.Index; diff --git a/src/Controls/tests/Core.UnitTests/Menu/MenuBarTestBase.cs b/src/Controls/tests/Core.UnitTests/Menu/MenuTestBase.cs similarity index 96% rename from src/Controls/tests/Core.UnitTests/Menu/MenuBarTestBase.cs rename to src/Controls/tests/Core.UnitTests/Menu/MenuTestBase.cs index 68acef96757b..da1452e45d89 100644 --- a/src/Controls/tests/Core.UnitTests/Menu/MenuBarTestBase.cs +++ b/src/Controls/tests/Core.UnitTests/Menu/MenuTestBase.cs @@ -5,7 +5,7 @@ namespace Microsoft.Maui.Controls.Core.UnitTests.Menu { - public abstract class MenuBarTestBase : BaseTestFixture + public abstract class MenuTestBase : BaseTestFixture where TChildType : Element, TIChildType, new() where TTestType : class, Maui.IElement, IList, new() { diff --git a/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.Windows.cs b/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.Windows.cs new file mode 100644 index 000000000000..95b0927fc749 --- /dev/null +++ b/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.Windows.cs @@ -0,0 +1,63 @@ +using System.Threading.Tasks; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Platform; +using Microsoft.Maui.Handlers; +using Xunit; +using System.Linq; +using Microsoft.Maui.DeviceTests.Stubs; + +namespace Microsoft.Maui.DeviceTests +{ + public partial class ContextFlyoutTests : HandlerTestBase + { + [Fact(DisplayName = "Context flyout creates expected WinUI elements")] + public async Task ContextFlyoutCreatesExpectedWinUIElements() + { + SetupBuilder(); + var toolbarItem = new ToolbarItem() { Text = "Toolbar Item 1" }; + var firstPage = new ContentPage(); + + var window = new Window(firstPage); + + await CreateHandlerAndAddToWindow(window, async (handler) => + { + var labelWithContextFlyout = new Label(); + var menu1 = new MenuFlyoutItem() { Text = "Menu1" }; + var menu2 = new MenuFlyoutItem() { Text = "Menu2" }; + var menu3 = new MenuFlyoutSeparator(); + + var menu4 = new MenuFlyoutSubItem() { Text = "Menu4" }; + menu4.Add(new MenuFlyoutItem() { Text = "Menu4-a" }); + menu4.Add(new MenuFlyoutItem() { Text = "Menu4-b" }); + + var menuFlyout = new MenuFlyout(); + menuFlyout.Add(menu1); + menuFlyout.Add(menu2); + menuFlyout.Add(menu3); + menuFlyout.Add(menu4); + + FlyoutBase.SetContextFlyout(labelWithContextFlyout, menuFlyout); + + var contentPage = new ContentPage() + { + Content = labelWithContextFlyout, + }; + + window.Page = contentPage; + + await OnLoadedAsync(contentPage); + + var winLabel = ((LabelHandler)labelWithContextFlyout.Handler).PlatformView; + var contextFlyoutItems = ((Microsoft.UI.Xaml.Controls.MenuFlyout)winLabel.ContextFlyout).Items; + Assert.Equal(4, contextFlyoutItems.Count); + Assert.Equal("Menu1", ((Microsoft.UI.Xaml.Controls.MenuFlyoutItem)contextFlyoutItems[0]).Text); + Assert.Equal("Menu2", ((Microsoft.UI.Xaml.Controls.MenuFlyoutItem)contextFlyoutItems[1]).Text); + Assert.IsType(contextFlyoutItems[2]); + Assert.Equal("Menu4", ((Microsoft.UI.Xaml.Controls.MenuFlyoutSubItem)contextFlyoutItems[3]).Text); + Assert.Equal(2, ((Microsoft.UI.Xaml.Controls.MenuFlyoutSubItem)contextFlyoutItems[3]).Items.Count); + Assert.Equal("Menu4-a", ((Microsoft.UI.Xaml.Controls.MenuFlyoutItem)((Microsoft.UI.Xaml.Controls.MenuFlyoutSubItem)contextFlyoutItems[3]).Items[0]).Text); + Assert.Equal("Menu4-b", ((Microsoft.UI.Xaml.Controls.MenuFlyoutItem)((Microsoft.UI.Xaml.Controls.MenuFlyoutSubItem)contextFlyoutItems[3]).Items[1]).Text); + }); + } + } +} diff --git a/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.cs b/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.cs new file mode 100644 index 000000000000..899c2cf1c516 --- /dev/null +++ b/src/Controls/tests/DeviceTests/Elements/ContextFlyout/ContextFlyoutTests.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Maui; +using Microsoft.Maui.Controls; +using Microsoft.Maui.Controls.Handlers; +using Microsoft.Maui.Platform; +using Microsoft.Extensions.DependencyInjection; +using Xunit; +using Microsoft.Maui.Hosting; +using Microsoft.Maui.Handlers; +using Microsoft.Maui.Graphics; +using Microsoft.Maui.DeviceTests.Stubs; + +namespace Microsoft.Maui.DeviceTests +{ + + [Category(TestCategory.MenuFlyout)] + public partial class ContextFlyoutTests : HandlerTestBase + { + void SetupBuilder() + { + EnsureHandlerCreated(builder => + { + builder.ConfigureMauiHandlers(handlers => + { + handlers.AddHandler(); + handlers.AddHandler(); + handlers.AddHandler(); + + handlers.AddHandler(); + handlers.AddHandler(); + handlers.AddHandler(); + handlers.AddHandler(); + }); + }); + } + } +} diff --git a/src/Controls/tests/DeviceTests/TestCategory.cs b/src/Controls/tests/DeviceTests/TestCategory.cs index 2e2cc33d1f30..14f89ad3b469 100644 --- a/src/Controls/tests/DeviceTests/TestCategory.cs +++ b/src/Controls/tests/DeviceTests/TestCategory.cs @@ -7,6 +7,7 @@ public static class TestCategory public const string CheckBox = "CheckBox"; public const string Compatibility = "Compatibility"; public const string ContentView = "ContentView"; + public const string MenuFlyout = nameof(MenuFlyout); public const string Dispatcher = "Dispatcher"; public const string Editor = "Editor"; public const string Element = "Element"; diff --git a/src/Core/src/Core/IContextFlyoutElement.cs b/src/Core/src/Core/IContextFlyoutElement.cs new file mode 100644 index 000000000000..5ada1555b41d --- /dev/null +++ b/src/Core/src/Core/IContextFlyoutElement.cs @@ -0,0 +1,13 @@ +namespace Microsoft.Maui +{ + /// + /// Represents a view that can contain a context flyout menu, which is usually represented as a right-click menu. + /// + public interface IContextFlyoutElement + { + /// + /// Gets the for the view. Menu flyouts, menu flyout subitems, and menu flyout separators can be added to the context flyout. + /// + IFlyout? ContextFlyout { get; } + } +} diff --git a/src/Core/src/Core/IMenuFlyout.cs b/src/Core/src/Core/IMenuFlyout.cs new file mode 100644 index 000000000000..0c8bb5d75604 --- /dev/null +++ b/src/Core/src/Core/IMenuFlyout.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic; + +namespace Microsoft.Maui +{ + + public interface IMenuFlyout : IList, IFlyout + { + } +} diff --git a/src/Core/src/Handlers/MenuFlyoutHandler/IMenuFlyoutHandler.cs b/src/Core/src/Handlers/MenuFlyoutHandler/IMenuFlyoutHandler.cs new file mode 100644 index 000000000000..f91952e6333a --- /dev/null +++ b/src/Core/src/Handlers/MenuFlyoutHandler/IMenuFlyoutHandler.cs @@ -0,0 +1,19 @@ +#if WINDOWS +using PlatformView = Microsoft.UI.Xaml.Controls.MenuFlyout; +#else +using PlatformView = System.Object; +#endif + +namespace Microsoft.Maui.Handlers +{ + public interface IMenuFlyoutHandler : IElementHandler + { + void Add(IMenuElement view); + void Remove(IMenuElement view); + void Clear(); + void Insert(int index, IMenuElement view); + + new PlatformView PlatformView { get; } + new IMenuFlyout VirtualView { get; } + } +} diff --git a/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Android.cs b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Android.cs new file mode 100644 index 000000000000..4dd79521bcc4 --- /dev/null +++ b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Android.cs @@ -0,0 +1,28 @@ +using System; + +namespace Microsoft.Maui.Handlers +{ + public partial class MenuFlyoutHandler : ElementHandler, IMenuFlyoutHandler + { + protected override object CreatePlatformElement() + { + throw new NotImplementedException(); + } + + public void Add(IMenuElement view) + { + } + + public void Remove(IMenuElement view) + { + } + + public void Clear() + { + } + + public void Insert(int index, IMenuElement view) + { + } + } +} diff --git a/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Standard.cs b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Standard.cs new file mode 100644 index 000000000000..4dd79521bcc4 --- /dev/null +++ b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Standard.cs @@ -0,0 +1,28 @@ +using System; + +namespace Microsoft.Maui.Handlers +{ + public partial class MenuFlyoutHandler : ElementHandler, IMenuFlyoutHandler + { + protected override object CreatePlatformElement() + { + throw new NotImplementedException(); + } + + public void Add(IMenuElement view) + { + } + + public void Remove(IMenuElement view) + { + } + + public void Clear() + { + } + + public void Insert(int index, IMenuElement view) + { + } + } +} diff --git a/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Tizen.cs b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Tizen.cs new file mode 100644 index 000000000000..4dd79521bcc4 --- /dev/null +++ b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Tizen.cs @@ -0,0 +1,28 @@ +using System; + +namespace Microsoft.Maui.Handlers +{ + public partial class MenuFlyoutHandler : ElementHandler, IMenuFlyoutHandler + { + protected override object CreatePlatformElement() + { + throw new NotImplementedException(); + } + + public void Add(IMenuElement view) + { + } + + public void Remove(IMenuElement view) + { + } + + public void Clear() + { + } + + public void Insert(int index, IMenuElement view) + { + } + } +} diff --git a/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Windows.cs b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Windows.cs new file mode 100644 index 000000000000..8e0616c31225 --- /dev/null +++ b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.Windows.cs @@ -0,0 +1,46 @@ +using Microsoft.UI.Xaml.Controls; + +namespace Microsoft.Maui.Handlers +{ + public partial class MenuFlyoutHandler : ElementHandler, IMenuFlyoutHandler + { + protected override MenuFlyout CreatePlatformElement() + { + return new MenuFlyout(); + } + + public override void SetVirtualView(IElement view) + { + base.SetVirtualView(view); + Clear(); + + foreach (var item in (IMenuFlyout)view) + { + Add(item); + } + } + + public void Add(IMenuElement view) + { + PlatformView.Items.Add((MenuFlyoutItemBase)view.ToPlatform(MauiContext!)); + } + + public void Remove(IMenuElement view) + { + if (view.Handler != null) + { + PlatformView.Items.Remove((MenuFlyoutItemBase)view.ToPlatform()); + } + } + + public void Clear() + { + PlatformView.Items.Clear(); + } + + public void Insert(int index, IMenuElement view) + { + PlatformView.Items.Insert(index, (MenuFlyoutItemBase)view.ToPlatform(MauiContext!)); + } + } +} diff --git a/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.cs b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.cs new file mode 100644 index 000000000000..65a6eff213d5 --- /dev/null +++ b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Text; +#if WINDOWS +using PlatformView = Microsoft.UI.Xaml.Controls.MenuFlyout; +#else +using PlatformView = System.Object; +#endif + +namespace Microsoft.Maui.Handlers +{ + public partial class MenuFlyoutHandler : IMenuFlyoutHandler + { + + public static IPropertyMapper Mapper = new PropertyMapper(ElementMapper) + { + }; + + public static CommandMapper CommandMapper = new(ElementCommandMapper) + { + [nameof(IMenuFlyoutHandler.Add)] = MapAdd, + [nameof(IMenuFlyoutHandler.Remove)] = MapRemove, + [nameof(IMenuFlyoutHandler.Clear)] = MapClear, + [nameof(IMenuFlyoutHandler.Insert)] = MapInsert, + }; + + public MenuFlyoutHandler() : this(Mapper, CommandMapper) + { + + } + + public MenuFlyoutHandler(IPropertyMapper mapper, CommandMapper? commandMapper = null) : base(mapper, commandMapper) + { + + } + + public static void MapAdd(IMenuFlyoutHandler handler, IMenuFlyout menuElement, object? arg) + { + if (arg is ContextFlyoutItemHandlerUpdate args) + { + handler.Add(args.MenuElement); + } + } + + public static void MapRemove(IMenuFlyoutHandler handler, IMenuFlyout menuElement, object? arg) + { + if (arg is ContextFlyoutItemHandlerUpdate args) + { + handler.Remove(args.MenuElement); + } + } + + public static void MapInsert(IMenuFlyoutHandler handler, IMenuFlyout menuElement, object? arg) + { + if (arg is ContextFlyoutItemHandlerUpdate args) + { + handler.Insert(args.Index, args.MenuElement); + } + } + + public static void MapClear(IMenuFlyoutHandler handler, IMenuFlyout menuElement, object? arg) + { + handler.Clear(); + } + + IMenuFlyout IMenuFlyoutHandler.VirtualView => VirtualView; + + PlatformView IMenuFlyoutHandler.PlatformView => PlatformView; + + private protected override void OnDisconnectHandler(object platformView) + { + base.OnDisconnectHandler(platformView); + foreach (var item in VirtualView) + { + item?.Handler?.DisconnectHandler(); + } + } + } +} diff --git a/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.iOS.cs b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.iOS.cs new file mode 100644 index 000000000000..9e68455442e4 --- /dev/null +++ b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutHandler.iOS.cs @@ -0,0 +1,46 @@ +using System; +using UIKit; + +namespace Microsoft.Maui.Handlers +{ + [System.Runtime.Versioning.SupportedOSPlatform("ios13.0")] + public partial class MenuFlyoutHandler : ElementHandler, IMenuFlyoutHandler + { + protected override UIMenu CreatePlatformElement() + { + var platformMenu = + VirtualView + .ToPlatformMenu(MauiContext!); + + return platformMenu; + } + + public void Add(IMenuElement view) + { + Rebuild(); + } + + public void Remove(IMenuElement view) + { + Rebuild(); + } + + public void Clear() + { + Rebuild(); + } + + public void Insert(int index, IMenuElement view) + { + Rebuild(); + } + + internal static void Rebuild() + { + // TODO: Need to figure out how to rebuild the menu items for the entire context menu. On iOS/MacCat you + // can't add/remove individual menu items. You can call UIMenu.GetMenuByReplacingChildren(newChildren) to + // rebuild a specific menu, but that needs to be done at the "top" (the menu itself, not individual sub-items). + // https://github.com/dotnet/maui/issues/9359 + } + } +} diff --git a/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutItemHandlerUpdate.cs b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutItemHandlerUpdate.cs new file mode 100644 index 000000000000..7949c73d2598 --- /dev/null +++ b/src/Core/src/Handlers/MenuFlyoutHandler/MenuFlyoutItemHandlerUpdate.cs @@ -0,0 +1,9 @@ +#nullable enable + +namespace Microsoft.Maui.Handlers +{ + /// + /// Communicates information from an IMenuFlyout about updates to an IMenuFlyoutHandler + /// + public record ContextFlyoutItemHandlerUpdate(int Index, IMenuElement MenuElement); +} diff --git a/src/Core/src/Handlers/MenuFlyoutItem/MenuFlyoutItemHandler.iOS.cs b/src/Core/src/Handlers/MenuFlyoutItem/MenuFlyoutItemHandler.iOS.cs index d5f29d3f6fb9..7f271911f4af 100644 --- a/src/Core/src/Handlers/MenuFlyoutItem/MenuFlyoutItemHandler.iOS.cs +++ b/src/Core/src/Handlers/MenuFlyoutItem/MenuFlyoutItemHandler.iOS.cs @@ -12,8 +12,38 @@ public partial class MenuFlyoutItemHandler { static Dictionary menus = new Dictionary(); + bool IsInContextFlyout() + { + IElement? current = VirtualView; + while (current != null) + { + if (current is Microsoft.Maui.IMenuFlyout) + { + return true; + } + current = current.Parent; + } + return false; + } + protected override UIMenuElement CreatePlatformElement() { + // https://github.com/dotnet/maui/issues/9332 + // The menu code needs to be converted over to using `UIAction` + // so that all of this can be the same + if (IsInContextFlyout()) + { + UIImage? contextUiImage = VirtualView.Source.GetPlatformMenuImage(MauiContext!); + + var uiAction = UIAction.Create( + title: VirtualView.Text, + image: contextUiImage, + identifier: null, + handler: (_) => VirtualView?.Clicked()); + + return uiAction; + } + int index = menus.Count; UIImage? uiImage = VirtualView.Source.GetPlatformMenuImage(MauiContext!); var selector = new Selector($"MenuItem{index}:"); diff --git a/src/Core/src/Handlers/MenuFlyoutSubItem/MenuFlyoutSubItemHandler.iOS.cs b/src/Core/src/Handlers/MenuFlyoutSubItem/MenuFlyoutSubItemHandler.iOS.cs index 9f0bf8f65702..80f51ec5bec2 100644 --- a/src/Core/src/Handlers/MenuFlyoutSubItem/MenuFlyoutSubItemHandler.iOS.cs +++ b/src/Core/src/Handlers/MenuFlyoutSubItem/MenuFlyoutSubItemHandler.iOS.cs @@ -53,6 +53,10 @@ public void Insert(int index, IMenuElement view) void Rebuild() { + // For context flyout support this likely also needs some logic like in MenuFlyoutItemHandler.iOS.cs where + // it follows one code path for main menus (this existing code), and a different code path for context menus that + // rebuilds the UIMenu of the context menu. + // https://github.com/dotnet/maui/issues/9359 MenuBarHandler.Rebuild(); } } diff --git a/src/Core/src/Handlers/View/ViewHandler.Android.cs b/src/Core/src/Handlers/View/ViewHandler.Android.cs index ccb0e7f57bc0..fe33ef6ca0a7 100644 --- a/src/Core/src/Handlers/View/ViewHandler.Android.cs +++ b/src/Core/src/Handlers/View/ViewHandler.Android.cs @@ -180,6 +180,10 @@ internal static void MapToolbar(IElementHandler handler, IToolbarElement te) appbarLayout.AddView(nativeToolBar, 0); } + public static void MapContextFlyout(IViewHandler handler, IView view) + { + } + public virtual bool NeedsContainer { get diff --git a/src/Core/src/Handlers/View/ViewHandler.Standard.cs b/src/Core/src/Handlers/View/ViewHandler.Standard.cs index 40a314cb36fc..2d035fe1f744 100644 --- a/src/Core/src/Handlers/View/ViewHandler.Standard.cs +++ b/src/Core/src/Handlers/View/ViewHandler.Standard.cs @@ -22,6 +22,8 @@ public static void MapAnchorX(IViewHandler handler, IView view) { } public static void MapAnchorY(IViewHandler handler, IView view) { } + public static void MapContextFlyout(IViewHandler handler, IView view) { } + public virtual bool NeedsContainer => false; } } \ No newline at end of file diff --git a/src/Core/src/Handlers/View/ViewHandler.Tizen.cs b/src/Core/src/Handlers/View/ViewHandler.Tizen.cs index ac452ade2109..acfe080adffa 100644 --- a/src/Core/src/Handlers/View/ViewHandler.Tizen.cs +++ b/src/Core/src/Handlers/View/ViewHandler.Tizen.cs @@ -61,6 +61,8 @@ public static void MapAnchorY(IViewHandler handler, IView view) UpdateTransformation(handler, view); } + public static void MapContextFlyout(IViewHandler handler, IView view) { } + internal static void UpdateTransformation(IViewHandler handler, IView view) { handler.ToPlatform()?.UpdateTransformation(view); diff --git a/src/Core/src/Handlers/View/ViewHandler.Windows.cs b/src/Core/src/Handlers/View/ViewHandler.Windows.cs index 9ee2f8eb1f91..8b0b85adb7b4 100644 --- a/src/Core/src/Handlers/View/ViewHandler.Windows.cs +++ b/src/Core/src/Handlers/View/ViewHandler.Windows.cs @@ -1,6 +1,10 @@ #nullable enable using System; +using System.Collections.Generic; +using System.ComponentModel; using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; using PlatformView = Microsoft.UI.Xaml.FrameworkElement; namespace Microsoft.Maui.Handlers @@ -98,6 +102,37 @@ internal static void MapToolbar(IElementHandler handler, IToolbarElement toolbar } } + public static void MapContextFlyout(IViewHandler handler, IView view) + { + if (view is IContextFlyoutElement contextFlyoutContainer) + { + MapContextFlyout(handler, contextFlyoutContainer); + } + } + + internal static void MapContextFlyout(IElementHandler handler, IContextFlyoutElement contextFlyoutContainer) + { + _ = handler.MauiContext ?? throw new InvalidOperationException($"The handler's {nameof(handler.MauiContext)} cannot be null."); + + if (handler.PlatformView is Microsoft.UI.Xaml.UIElement uiElement) + { + if (contextFlyoutContainer.ContextFlyout != null) + { + var contextFlyoutHandler = contextFlyoutContainer.ContextFlyout.ToHandler(handler.MauiContext); + var contextFlyoutPlatformView = contextFlyoutHandler.PlatformView; + + if (contextFlyoutPlatformView is FlyoutBase flyoutBase) + { + uiElement.ContextFlyout = flyoutBase; + } + } + else + { + uiElement.ClearValue(UIElement.ContextFlyoutProperty); + } + } + } + public virtual bool NeedsContainer { get diff --git a/src/Core/src/Handlers/View/ViewHandler.cs b/src/Core/src/Handlers/View/ViewHandler.cs index 1d29713cacec..c401adaa840d 100644 --- a/src/Core/src/Handlers/View/ViewHandler.cs +++ b/src/Core/src/Handlers/View/ViewHandler.cs @@ -55,7 +55,10 @@ public abstract partial class ViewHandler : ElementHandler, IViewHandler #endif [nameof(IView.InputTransparent)] = MapInputTransparent, [nameof(IToolTipElement.ToolTip)] = MapToolTip, - }; +#if WINDOWS || MACCATALYST + [nameof(IContextFlyoutElement.ContextFlyout)] = MapContextFlyout, +#endif + }; public static CommandMapper ViewCommandMapper = new() { diff --git a/src/Core/src/Handlers/View/ViewHandler.iOS.cs b/src/Core/src/Handlers/View/ViewHandler.iOS.cs index b5a595ed84a4..81dea8e249a7 100644 --- a/src/Core/src/Handlers/View/ViewHandler.iOS.cs +++ b/src/Core/src/Handlers/View/ViewHandler.iOS.cs @@ -1,9 +1,57 @@ -using PlatformView = UIKit.UIView; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using CoreGraphics; +using Foundation; +using ObjCRuntime; +using UIKit; +using PlatformView = UIKit.UIView; namespace Microsoft.Maui.Handlers { public partial class ViewHandler { + + [System.Runtime.Versioning.SupportedOSPlatform("ios13.0")] + public static void MapContextFlyout(IViewHandler handler, IView view) + { +#if MACCATALYST + if (view is IContextFlyoutElement contextFlyoutContainer) + { + MapContextFlyout(handler, contextFlyoutContainer); + } +#endif + } + +#if MACCATALYST + [System.Runtime.Versioning.SupportedOSPlatform("ios13.0")] + internal static void MapContextFlyout(IElementHandler handler, IContextFlyoutElement contextFlyoutContainer) + { + _ = handler.MauiContext ?? throw new InvalidOperationException($"The handler's {nameof(handler.MauiContext)} cannot be null."); + + if (handler.PlatformView is PlatformView uiView) + { + MauiUIContextMenuInteraction? currentInteraction = null; + + foreach (var interaction in uiView.Interactions) + { + if (interaction is MauiUIContextMenuInteraction menuInteraction) + currentInteraction = menuInteraction; + } + + if (contextFlyoutContainer.ContextFlyout != null) + { + if (currentInteraction == null) + uiView.AddInteraction(new MauiUIContextMenuInteraction(handler)); + } + else if (currentInteraction != null) + { + uiView.RemoveInteraction(currentInteraction); + } + } + } +#endif + static partial void MappingFrame(IViewHandler handler, IView view) { UpdateTransformation(handler, view); diff --git a/src/Core/src/Handlers/WebView/WebViewHandler.iOS.cs b/src/Core/src/Handlers/WebView/WebViewHandler.iOS.cs index 9100dd98459c..eaf0513eeec1 100644 --- a/src/Core/src/Handlers/WebView/WebViewHandler.iOS.cs +++ b/src/Core/src/Handlers/WebView/WebViewHandler.iOS.cs @@ -8,7 +8,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Maui.Graphics; using WebKit; -using RectangleF = CoreGraphics.CGRect; namespace Microsoft.Maui.Handlers { @@ -18,22 +17,15 @@ public partial class WebViewHandler : ViewHandler protected virtual float MinimumSize => 44f; - internal WebNavigationEvent _lastBackForwardEvent; WKUIDelegate? _delegate; protected override WKWebView CreatePlatformView() => new MauiWKWebView(this); - internal WebNavigationEvent CurrentNavigationEvent - { - get => _lastBackForwardEvent; - set => _lastBackForwardEvent = value; - } - public static void MapWKUIDelegate(IWebViewHandler handler, IWebView webView) { if (handler is WebViewHandler platformHandler) - handler.PlatformView.UIDelegate = platformHandler._delegate ??= new MauiWebViewUIDelegate(); + handler.PlatformView.UIDelegate = platformHandler._delegate ??= new MauiWebViewUIDelegate(handler); } public static void MapSource(IWebViewHandler handler, IWebView webView) @@ -45,16 +37,16 @@ public static void MapSource(IWebViewHandler handler, IWebView webView) public static void MapGoBack(IWebViewHandler handler, IWebView webView, object? arg) { - if (handler.PlatformView.CanGoBack && handler is WebViewHandler w) - w.CurrentNavigationEvent = WebNavigationEvent.Back; + if (handler.PlatformView.CanGoBack && handler.PlatformView.NavigationDelegate is MauiWebViewNavigationDelegate mauiDelegate) + mauiDelegate.CurrentNavigationEvent = WebNavigationEvent.Back; handler.PlatformView?.UpdateGoBack(webView); } public static void MapGoForward(IWebViewHandler handler, IWebView webView, object? arg) { - if (handler.PlatformView.CanGoForward && handler is WebViewHandler w) - w.CurrentNavigationEvent = WebNavigationEvent.Forward; + if (handler.PlatformView.CanGoForward && handler.PlatformView.NavigationDelegate is MauiWebViewNavigationDelegate mauiDelegate) + mauiDelegate.CurrentNavigationEvent = WebNavigationEvent.Forward; handler.PlatformView?.UpdateGoForward(webView); } @@ -79,8 +71,8 @@ public static async void MapReload(IWebViewHandler handler, IWebView webView, ob handler.MauiContext?.CreateLogger()?.LogWarning(exc, "Syncing Existing Cookies Failed"); } - if (handler is WebViewHandler w) - w.CurrentNavigationEvent = WebNavigationEvent.Refresh; + if (handler.PlatformView.NavigationDelegate is MauiWebViewNavigationDelegate mauiDelegate) + mauiDelegate.CurrentNavigationEvent = WebNavigationEvent.Refresh; handler.PlatformView?.UpdateReload(webView); } diff --git a/src/Core/src/IFlyout.cs b/src/Core/src/IFlyout.cs new file mode 100644 index 000000000000..69c564b4a8e9 --- /dev/null +++ b/src/Core/src/IFlyout.cs @@ -0,0 +1,7 @@ +namespace Microsoft.Maui +{ + public interface IFlyout : IElement + { + + } +} diff --git a/src/Core/src/Platform/iOS/MauiUIContextMenuInteraction.cs b/src/Core/src/Platform/iOS/MauiUIContextMenuInteraction.cs new file mode 100644 index 000000000000..ddc36c4b3dc0 --- /dev/null +++ b/src/Core/src/Platform/iOS/MauiUIContextMenuInteraction.cs @@ -0,0 +1,76 @@ +using System; +using System.Runtime.Versioning; +using CoreGraphics; +using Foundation; +using UIKit; + +namespace Microsoft.Maui.Platform +{ + [SupportedOSPlatform("ios13.0")] + [SupportedOSPlatform("maccatalyst13.0.0")] + [UnsupportedOSPlatform("tvos")] + class MauiUIContextMenuInteraction : UIContextMenuInteraction + { + WeakReference _handler; + + // Store a reference to the platform delegate so that it is not garbage collected + IUIContextMenuInteractionDelegate? _uiContextMenuInteractionDelegate; + + public MauiUIContextMenuInteraction(IElementHandler handler) + : base(new FlyoutUIContextMenuInteractionDelegate()) + { + _uiContextMenuInteractionDelegate = Delegate; + _handler = new WeakReference(handler); + } + + public UIContextMenuConfiguration? GetConfigurationForMenu() + { + var contextFlyout = (Handler?.VirtualView as IContextFlyoutElement)?.ContextFlyout; + var mauiContext = Handler?.MauiContext; + + if (contextFlyout == null || mauiContext == null) + return null; + + var contextFlyoutHandler = contextFlyout.ToHandler(mauiContext); + var contextFlyoutPlatformView = contextFlyoutHandler.PlatformView; + + if (contextFlyoutPlatformView is UIMenu uiMenu) + { + return UIContextMenuConfiguration.Create( + identifier: null, + previewProvider: null, + actionProvider: _ => uiMenu); + } + + return null; + } + + IElementHandler? Handler + { + get + { + if (_handler.TryGetTarget(out var handler)) + { + return handler; + } + + return null; + } + } + + sealed class FlyoutUIContextMenuInteractionDelegate : NSObject, IUIContextMenuInteractionDelegate + { + public FlyoutUIContextMenuInteractionDelegate() + { + } + + public UIContextMenuConfiguration? GetConfigurationForMenu(UIContextMenuInteraction interaction, CGPoint location) + { + if (interaction is MauiUIContextMenuInteraction contextMenu) + return contextMenu.GetConfigurationForMenu(); + + return null; + } + } + } +} diff --git a/src/Core/src/Platform/iOS/MauiWebViewNavigationDelegate.cs b/src/Core/src/Platform/iOS/MauiWebViewNavigationDelegate.cs index 0606087d7cca..0e5ee6206fbe 100644 --- a/src/Core/src/Platform/iOS/MauiWebViewNavigationDelegate.cs +++ b/src/Core/src/Platform/iOS/MauiWebViewNavigationDelegate.cs @@ -13,26 +13,13 @@ namespace Microsoft.Maui.Platform // so we'd like to stick with the older one for now public class MauiWebViewNavigationDelegate : NSObject, IWKNavigationDelegate { - readonly WeakReference _handler; + readonly WeakReference _handler; WebNavigationEvent _lastEvent; - public MauiWebViewNavigationDelegate(WebViewHandler handler) + public MauiWebViewNavigationDelegate(IWebViewHandler handler) { _ = handler ?? throw new ArgumentNullException("handler"); - _handler = new WeakReference(handler); - } - - WebViewHandler? Handler - { - get - { - if (_handler.TryGetTarget(out var handler)) - { - return handler; - } - - return null; - } + _handler = new WeakReference(handler); } [Export("webView:didFinishNavigation:")] @@ -125,7 +112,7 @@ public void DecidePolicy(WKWebView webView, WKNavigationAction navigationAction, navEvent = WebNavigationEvent.NewPage; break; case WKNavigationType.BackForward: - navEvent = handler.CurrentNavigationEvent; + navEvent = CurrentNavigationEvent; break; case WKNavigationType.Reload: navEvent = WebNavigationEvent.Refresh; @@ -157,5 +144,24 @@ string GetCurrentUrl() { return Handler?.PlatformView?.Url?.AbsoluteUrl?.ToString() ?? string.Empty; } + + internal WebNavigationEvent CurrentNavigationEvent + { + get; + set; + } + + IWebViewHandler? Handler + { + get + { + if (_handler.TryGetTarget(out var handler)) + { + return handler; + } + + return null; + } + } } } \ No newline at end of file diff --git a/src/Core/src/Platform/iOS/MauiWebViewUIDelegate.cs b/src/Core/src/Platform/iOS/MauiWebViewUIDelegate.cs index bc9e753c3175..7415b63304c3 100644 --- a/src/Core/src/Platform/iOS/MauiWebViewUIDelegate.cs +++ b/src/Core/src/Platform/iOS/MauiWebViewUIDelegate.cs @@ -1,16 +1,42 @@ -#nullable disable -using System; +using System; using Foundation; using UIKit; using WebKit; namespace Microsoft.Maui.Platform { - class MauiWebViewUIDelegate : WKUIDelegate + public class MauiWebViewUIDelegate : WKUIDelegate { + WeakReference _handler; static readonly string LocalOK = NSBundle.FromIdentifier("com.apple.UIKit").GetLocalizedString("OK"); static readonly string LocalCancel = NSBundle.FromIdentifier("com.apple.UIKit").GetLocalizedString("Cancel"); + public MauiWebViewUIDelegate(IWebViewHandler handler) + { + _ = handler ?? throw new ArgumentNullException("handler"); + _handler = new WeakReference(handler); + } + + public override void SetContextMenuConfiguration(WKWebView webView, WKContextMenuElementInfo elementInfo, Action completionHandler) + { + if (!OperatingSystem.IsIOSVersionAtLeast(13)) + return; + + foreach (var interaction in webView.Interactions) + { + if (interaction is MauiUIContextMenuInteraction cmi) + { + var contextMenu = cmi.GetConfigurationForMenu(); + if (contextMenu != null) + completionHandler(contextMenu); + + break; + } + } + + return; + } + public override void RunJavaScriptAlertPanel(WKWebView webView, string message, WKFrameInfo frame, Action completionHandler) { PresentAlertController( @@ -31,14 +57,16 @@ public override void RunJavaScriptConfirmPanel(WKWebView webView, string message } public override void RunJavaScriptTextInputPanel( - WKWebView webView, string prompt, string defaultText, WKFrameInfo frame, Action completionHandler) + WKWebView webView, string prompt, string? defaultText, WKFrameInfo frame, Action completionHandler) { + // TODO the okAction and cancelAction were already taking null when I removed `#nullable disable` + // and it doesn't seem to have been causing issues so leaving for now PresentAlertController( webView, prompt, defaultText: defaultText, - okAction: x => completionHandler(x.TextFields[0].Text), - cancelAction: _ => completionHandler(null) + okAction: x => completionHandler(x.TextFields[0].Text!), + cancelAction: _ => completionHandler(null!) ); } @@ -72,9 +100,9 @@ static UIAlertAction AddCancelAction(UIAlertController controller, Action handle static void PresentAlertController( WKWebView webView, string message, - string defaultText = null, - Action okAction = null, - Action cancelAction = null) + string? defaultText = null, + Action? okAction = null, + Action? cancelAction = null) { var controller = UIAlertController.Create(GetJsAlertTitle(webView), message, UIAlertControllerStyle.Alert); @@ -87,8 +115,21 @@ static void PresentAlertController( if (cancelAction != null) AddCancelAction(controller, () => cancelAction(controller)); - GetTopViewController(UIApplication.SharedApplication.GetKeyWindow().RootViewController) - .PresentViewController(controller, true, null); + + var handler = (webView.UIDelegate as MauiWebViewUIDelegate)?.Handler; + + UIViewController? rootViewController = null; + + if (handler != null) + rootViewController = handler.MauiContext?.GetPlatformWindow()?.RootViewController; + + rootViewController ??= UIApplication.SharedApplication?.GetKeyWindow()?.RootViewController; + + if (rootViewController != null) + { + GetTopViewController(rootViewController) + .PresentViewController(controller, true, null); + } } static UIViewController GetTopViewController(UIViewController viewController) @@ -96,7 +137,7 @@ static UIViewController GetTopViewController(UIViewController viewController) if (viewController is UINavigationController navigationController) return GetTopViewController(navigationController.VisibleViewController); - if (viewController is UITabBarController tabBarController) + if (viewController is UITabBarController tabBarController && tabBarController.SelectedViewController != null) return GetTopViewController(tabBarController.SelectedViewController); if (viewController.PresentedViewController != null) @@ -104,5 +145,18 @@ static UIViewController GetTopViewController(UIViewController viewController) return viewController; } + + IWebViewHandler? Handler + { + get + { + if (_handler.TryGetTarget(out var handler)) + { + return handler; + } + + return null; + } + } } } \ No newline at end of file diff --git a/src/Core/src/Platform/iOS/MenuExtensions.cs b/src/Core/src/Platform/iOS/MenuExtensions.cs index 5058cca46d65..26724acabaed 100644 --- a/src/Core/src/Platform/iOS/MenuExtensions.cs +++ b/src/Core/src/Platform/iOS/MenuExtensions.cs @@ -37,6 +37,27 @@ internal static string GetIdentifier(this UIMenu uIMenu) return (NSString)uIMenu.PerformSelector(new Selector("identifier")); } + [System.Runtime.Versioning.SupportedOSPlatform("ios13.0")] + internal static UIMenu ToPlatformMenu( + this IList menuElements, + IMauiContext mauiContext) + { + UIMenuElement[] platformMenuElements = new UIMenuElement[menuElements.Count]; + + for (int i = 0; i < menuElements.Count; i++) + { + var item = menuElements[i]; + var menuElement = (UIMenuElement)item.ToHandler(mauiContext)!.PlatformView!; + platformMenuElements[i] = menuElement; + } + +#pragma warning disable CA1416 + var platformMenu = UIMenu.Create(children: platformMenuElements); +#pragma warning restore CA1416 + + return platformMenu; + } + [System.Runtime.Versioning.SupportedOSPlatform("ios13.0")] internal static UIMenu ToPlatformMenu( this IList menuElements, diff --git a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt index c8a9bacc073c..c3ec1af09a5c 100644 --- a/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1,10 +1,34 @@ #nullable enable +Microsoft.Maui.Handlers.MenuFlyoutHandler +Microsoft.Maui.Handlers.MenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.ContextFlyoutItemHandlerUpdate(int Index, Microsoft.Maui.IMenuElement! MenuElement) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.get -> int +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.init -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.get -> Microsoft.Maui.IMenuElement! +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.init -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.PlatformView.get -> object! +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyout! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.PlatformView.get -> object! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyoutSeparator! Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler() -> void Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.IContextFlyoutElement.ContextFlyout.get -> Microsoft.Maui.IFlyout? +Microsoft.Maui.IFlyout +Microsoft.Maui.IMenuFlyout +Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? @@ -12,6 +36,7 @@ Microsoft.Maui.ToolTip Microsoft.Maui.ToolTip.Content.get -> object? Microsoft.Maui.ToolTip.Content.set -> void Microsoft.Maui.ToolTip.ToolTip() -> void +override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> object! override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> object! override Microsoft.Maui.Handlers.EditorHandler.SetVirtualView(Microsoft.Maui.IView! view) -> void override Microsoft.Maui.Handlers.EntryHandler.SetVirtualView(Microsoft.Maui.IView! view) -> void @@ -31,9 +56,16 @@ override Microsoft.Maui.Platform.AccessibilityDelegateCompatWrapper.OnInitialize override Microsoft.Maui.Platform.AccessibilityDelegateCompatWrapper.PerformAccessibilityAction(Android.Views.View! host, int action, Android.OS.Bundle? args) -> bool override Microsoft.Maui.Platform.MauiAccessibilityDelegateCompat.OnInitializeAccessibilityNodeInfo(Android.Views.View! host, AndroidX.Core.View.Accessibility.AccessibilityNodeInfoCompat! info) -> void override Microsoft.Maui.Platform.NavigationViewFragment.OnCreateView(Android.Views.LayoutInflater! inflater, Android.Views.ViewGroup? container, Android.OS.Bundle? savedInstanceState) -> Android.Views.View! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapInsert(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.Mapper -> Microsoft.Maui.IPropertyMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapRemove(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.Mapper -> Microsoft.Maui.IPropertyMapper! static Microsoft.Maui.Handlers.ViewHandler.MapToolTip(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void +static Microsoft.Maui.Handlers.ViewHandler.MapContextFlyout(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void static Microsoft.Maui.Platform.SwitchExtensions.GetDefaultSwitchThumbDrawable(this AndroidX.AppCompat.Widget.SwitchCompat! aSwitch) -> Android.Graphics.Drawables.Drawable? static Microsoft.Maui.Platform.SwitchExtensions.GetDefaultSwitchTrackDrawable(this AndroidX.AppCompat.Widget.SwitchCompat! aSwitch) -> Android.Graphics.Drawables.Drawable? static Microsoft.Maui.Platform.ViewExtensions.UpdateToolTip(this Android.Views.View! view, Microsoft.Maui.ToolTip? tooltip) -> void diff --git a/src/Core/src/PublicAPI/net-ios/PublicAPI.Shipped.txt b/src/Core/src/PublicAPI/net-ios/PublicAPI.Shipped.txt index cf2fb5ff6070..2ac877192007 100644 --- a/src/Core/src/PublicAPI/net-ios/PublicAPI.Shipped.txt +++ b/src/Core/src/PublicAPI/net-ios/PublicAPI.Shipped.txt @@ -1553,7 +1553,6 @@ Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.DecidePolicy(WebKit.WKWebV Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.DidFailNavigation(WebKit.WKWebView! webView, WebKit.WKNavigation! navigation, Foundation.NSError! error) -> void Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.DidFailProvisionalNavigation(WebKit.WKWebView! webView, WebKit.WKNavigation! navigation, Foundation.NSError! error) -> void Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.DidFinishNavigation(WebKit.WKWebView! webView, WebKit.WKNavigation! navigation) -> void -Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.MauiWebViewNavigationDelegate(Microsoft.Maui.Handlers.WebViewHandler! handler) -> void Microsoft.Maui.Platform.MauiWKWebView Microsoft.Maui.Platform.MauiWKWebView.CurrentUrl.get -> string? Microsoft.Maui.Platform.MauiWKWebView.DidFinishNavigation(WebKit.WKWebView! webView, WebKit.WKNavigation! navigation) -> void diff --git a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt index 9991f84128a6..98d72cee6199 100644 --- a/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -1,10 +1,34 @@ #nullable enable +Microsoft.Maui.Handlers.MenuFlyoutHandler +Microsoft.Maui.Handlers.MenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.ContextFlyoutItemHandlerUpdate(int Index, Microsoft.Maui.IMenuElement! MenuElement) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.get -> int +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.init -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.get -> Microsoft.Maui.IMenuElement! +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.init -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.PlatformView.get -> object! +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyout! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.PlatformView.get -> UIKit.UIMenu! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyoutSeparator! Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler() -> void Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.IContextFlyoutElement.ContextFlyout.get -> Microsoft.Maui.IFlyout? +Microsoft.Maui.IFlyout +Microsoft.Maui.IMenuFlyout +Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? @@ -12,6 +36,9 @@ Microsoft.Maui.ToolTip Microsoft.Maui.ToolTip.Content.get -> object? Microsoft.Maui.ToolTip.Content.set -> void Microsoft.Maui.ToolTip.ToolTip() -> void +Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.MauiWebViewNavigationDelegate(Microsoft.Maui.Handlers.IWebViewHandler! handler) -> void +Microsoft.Maui.Platform.MauiWebViewUIDelegate +Microsoft.Maui.Platform.MauiWebViewUIDelegate.MauiWebViewUIDelegate(Microsoft.Maui.Handlers.IWebViewHandler! handler) -> void Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneContinueUserActivity Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneDidEnterBackground Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneDidFailToContinueUserActivity @@ -26,6 +53,7 @@ Microsoft.Maui.Platform.MauiWKWebView.MauiWKWebView(CoreGraphics.CGRect frame, M Microsoft.Maui.Platform.MauiWKWebView.MauiWKWebView(Microsoft.Maui.Handlers.WebViewHandler! handler) -> void override Microsoft.Maui.Handlers.BorderHandler.ConnectHandler(Microsoft.Maui.Platform.ContentView! platformView) -> void override Microsoft.Maui.Handlers.BorderHandler.DisconnectHandler(Microsoft.Maui.Platform.ContentView! platformView) -> void +override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> UIKit.UIMenu! override Microsoft.Maui.Handlers.ScrollViewHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect rect) -> void override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> UIKit.UIMenu! override Microsoft.Maui.Handlers.EditorHandler.SetVirtualView(Microsoft.Maui.IView! view) -> void @@ -37,9 +65,20 @@ override Microsoft.Maui.Platform.LayoutView.UserInteractionEnabled.get -> bool override Microsoft.Maui.Platform.LayoutView.UserInteractionEnabled.set -> void *REMOVED*override Microsoft.Maui.Handlers.LabelHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect rect) -> void *REMOVED*override Microsoft.Maui.Handlers.ScrollViewHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect frame) -> void +override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptAlertPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void +override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptConfirmPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void +override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptTextInputPanel(WebKit.WKWebView! webView, string! prompt, string? defaultText, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void +override Microsoft.Maui.Platform.MauiWebViewUIDelegate.SetContextMenuConfiguration(WebKit.WKWebView! webView, WebKit.WKContextMenuElementInfo! elementInfo, System.Action! completionHandler) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapInsert(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.Mapper -> Microsoft.Maui.IPropertyMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapRemove(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void override Microsoft.Maui.Platform.MauiSearchBar.WillMoveToWindow(UIKit.UIWindow? window) -> void static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.Mapper -> Microsoft.Maui.IPropertyMapper! +static Microsoft.Maui.Handlers.ViewHandler.MapContextFlyout(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.SceneContinueUserActivity(this Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! lifecycle, Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneContinueUserActivity! del) -> Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.SceneDidEnterBackground(this Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! lifecycle, Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneDidEnterBackground! del) -> Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.SceneDidFailToContinueUserActivity(this Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! lifecycle, Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneDidFailToContinueUserActivity! del) -> Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! @@ -60,6 +99,7 @@ static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.ApplicationS override Microsoft.Maui.Platform.MauiTextField.SelectedTextRange.get -> UIKit.UITextRange? override Microsoft.Maui.Platform.MauiTextField.SelectedTextRange.set -> void *REMOVED* override Microsoft.Maui.Handlers.PickerSource.Dispose(bool disposing) -> void +*REMOVED* Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.MauiWebViewNavigationDelegate(Microsoft.Maui.Handlers.WebViewHandler! handler) -> void virtual Microsoft.Maui.MauiUISceneDelegate.ContinueUserActivity(UIKit.UIScene! scene, Foundation.NSUserActivity! userActivity) -> bool virtual Microsoft.Maui.MauiUISceneDelegate.DidEnterBackground(UIKit.UIScene! scene) -> void virtual Microsoft.Maui.MauiUISceneDelegate.DidFailToContinueUserActivity(UIKit.UIScene! scene, string! userActivityType, Foundation.NSError! error) -> void diff --git a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Shipped.txt b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Shipped.txt index 9807d2dda3d7..85e6cf49ceab 100644 --- a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Shipped.txt +++ b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Shipped.txt @@ -1552,7 +1552,6 @@ Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.DecidePolicy(WebKit.WKWebV Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.DidFailNavigation(WebKit.WKWebView! webView, WebKit.WKNavigation! navigation, Foundation.NSError! error) -> void Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.DidFailProvisionalNavigation(WebKit.WKWebView! webView, WebKit.WKNavigation! navigation, Foundation.NSError! error) -> void Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.DidFinishNavigation(WebKit.WKWebView! webView, WebKit.WKNavigation! navigation) -> void -Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.MauiWebViewNavigationDelegate(Microsoft.Maui.Handlers.WebViewHandler! handler) -> void Microsoft.Maui.Platform.MauiWKWebView Microsoft.Maui.Platform.MauiWKWebView.CurrentUrl.get -> string? Microsoft.Maui.Platform.MauiWKWebView.DidFinishNavigation(WebKit.WKWebView! webView, WebKit.WKNavigation! navigation) -> void diff --git a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt index 9dbe66a62083..18ee174aecb8 100644 --- a/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -1,10 +1,34 @@ #nullable enable +Microsoft.Maui.Handlers.MenuFlyoutHandler +Microsoft.Maui.Handlers.MenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.ContextFlyoutItemHandlerUpdate(int Index, Microsoft.Maui.IMenuElement! MenuElement) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.get -> int +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.init -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.get -> Microsoft.Maui.IMenuElement! +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.init -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.PlatformView.get -> object! +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyout! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.PlatformView.get -> UIKit.UIMenu! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyoutSeparator! Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler() -> void Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.IContextFlyoutElement.ContextFlyout.get -> Microsoft.Maui.IFlyout? +Microsoft.Maui.IFlyout +Microsoft.Maui.IMenuFlyout +Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? @@ -12,6 +36,9 @@ Microsoft.Maui.ToolTip Microsoft.Maui.ToolTip.Content.get -> object? Microsoft.Maui.ToolTip.Content.set -> void Microsoft.Maui.ToolTip.ToolTip() -> void +Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.MauiWebViewNavigationDelegate(Microsoft.Maui.Handlers.IWebViewHandler! handler) -> void +Microsoft.Maui.Platform.MauiWebViewUIDelegate +Microsoft.Maui.Platform.MauiWebViewUIDelegate.MauiWebViewUIDelegate(Microsoft.Maui.Handlers.IWebViewHandler! handler) -> void Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneContinueUserActivity Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneDidEnterBackground Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneDidFailToContinueUserActivity @@ -26,6 +53,7 @@ Microsoft.Maui.Platform.MauiWKWebView.MauiWKWebView(CoreGraphics.CGRect frame, M Microsoft.Maui.Platform.MauiWKWebView.MauiWKWebView(Microsoft.Maui.Handlers.WebViewHandler! handler) -> void override Microsoft.Maui.Handlers.BorderHandler.ConnectHandler(Microsoft.Maui.Platform.ContentView! platformView) -> void override Microsoft.Maui.Handlers.BorderHandler.DisconnectHandler(Microsoft.Maui.Platform.ContentView! platformView) -> void +override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> UIKit.UIMenu! override Microsoft.Maui.Handlers.ScrollViewHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect rect) -> void override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> UIKit.UIMenu! override Microsoft.Maui.Handlers.EditorHandler.SetVirtualView(Microsoft.Maui.IView! view) -> void @@ -37,10 +65,21 @@ override Microsoft.Maui.Platform.LayoutView.UserInteractionEnabled.get -> bool override Microsoft.Maui.Platform.LayoutView.UserInteractionEnabled.set -> void *REMOVED*override Microsoft.Maui.Handlers.LabelHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect rect) -> void *REMOVED*override Microsoft.Maui.Handlers.ScrollViewHandler.PlatformArrange(Microsoft.Maui.Graphics.Rect frame) -> void +override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptAlertPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void +override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptConfirmPanel(WebKit.WKWebView! webView, string! message, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void +override Microsoft.Maui.Platform.MauiWebViewUIDelegate.RunJavaScriptTextInputPanel(WebKit.WKWebView! webView, string! prompt, string? defaultText, WebKit.WKFrameInfo! frame, System.Action! completionHandler) -> void +override Microsoft.Maui.Platform.MauiWebViewUIDelegate.SetContextMenuConfiguration(WebKit.WKWebView! webView, WebKit.WKContextMenuElementInfo! elementInfo, System.Action! completionHandler) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapInsert(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.Mapper -> Microsoft.Maui.IPropertyMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapRemove(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void override Microsoft.Maui.Platform.MauiSearchBar.WillMoveToWindow(UIKit.UIWindow? window) -> void static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.Mapper -> Microsoft.Maui.IPropertyMapper! static Microsoft.Maui.Handlers.ViewHandler.MapToolTip(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void +static Microsoft.Maui.Handlers.ViewHandler.MapContextFlyout(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.SceneContinueUserActivity(this Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! lifecycle, Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneContinueUserActivity! del) -> Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.SceneDidEnterBackground(this Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! lifecycle, Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneDidEnterBackground! del) -> Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.SceneDidFailToContinueUserActivity(this Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! lifecycle, Microsoft.Maui.LifecycleEvents.iOSLifecycle.SceneDidFailToContinueUserActivity! del) -> Microsoft.Maui.LifecycleEvents.IiOSLifecycleBuilder! @@ -60,6 +99,7 @@ static Microsoft.Maui.LifecycleEvents.iOSLifecycleBuilderExtensions.ApplicationS override Microsoft.Maui.Platform.MauiTextField.SelectedTextRange.get -> UIKit.UITextRange? override Microsoft.Maui.Platform.MauiTextField.SelectedTextRange.set -> void *REMOVED* override Microsoft.Maui.Handlers.PickerSource.Dispose(bool disposing) -> void +*REMOVED* Microsoft.Maui.Platform.MauiWebViewNavigationDelegate.MauiWebViewNavigationDelegate(Microsoft.Maui.Handlers.WebViewHandler! handler) -> void virtual Microsoft.Maui.MauiUISceneDelegate.ContinueUserActivity(UIKit.UIScene! scene, Foundation.NSUserActivity! userActivity) -> bool virtual Microsoft.Maui.MauiUISceneDelegate.DidEnterBackground(UIKit.UIScene! scene) -> void virtual Microsoft.Maui.MauiUISceneDelegate.DidFailToContinueUserActivity(UIKit.UIScene! scene, string! userActivityType, Foundation.NSError! error) -> void diff --git a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt index 95b76edffaf5..d6f0bc1c8561 100644 --- a/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-tizen/PublicAPI.Unshipped.txt @@ -1,10 +1,34 @@ #nullable enable +Microsoft.Maui.Handlers.MenuFlyoutHandler +Microsoft.Maui.Handlers.MenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.ContextFlyoutItemHandlerUpdate(int Index, Microsoft.Maui.IMenuElement! MenuElement) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.get -> int +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.init -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.get -> Microsoft.Maui.IMenuElement! +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.init -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.PlatformView.get -> object! +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyout! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.PlatformView.get -> object! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyoutSeparator! Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler() -> void Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.IMenuFlyout +Microsoft.Maui.IFlyout +Microsoft.Maui.IContextFlyoutElement +Microsoft.Maui.IContextFlyoutElement.ContextFlyout.get -> Microsoft.Maui.IFlyout? Microsoft.Maui.IMenuFlyoutSeparator Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? @@ -12,8 +36,16 @@ Microsoft.Maui.ToolTip Microsoft.Maui.ToolTip.Content.get -> object? Microsoft.Maui.ToolTip.Content.set -> void Microsoft.Maui.ToolTip.ToolTip() -> void +override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> object! override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> object! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapInsert(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.Mapper -> Microsoft.Maui.IPropertyMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapRemove(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.Mapper -> Microsoft.Maui.IPropertyMapper! static Microsoft.Maui.Handlers.ViewHandler.MapToolTip(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void static Microsoft.Maui.Platform.ViewExtensions.UpdateToolTip(this ElmSharp.EvasObject! platformView, Microsoft.Maui.ToolTip? tooltip) -> void +static Microsoft.Maui.Handlers.ViewHandler.MapContextFlyout(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void diff --git a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt index ddd3c95dcfa2..bbec454bb587 100644 --- a/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -1,11 +1,35 @@ #nullable enable *REMOVED*override Microsoft.Maui.Handlers.ScrollViewHandler.GetDesiredSize(double widthConstraint, double heightConstraint) -> Microsoft.Maui.Graphics.Size +Microsoft.Maui.Handlers.MenuFlyoutHandler +Microsoft.Maui.Handlers.MenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.ContextFlyoutItemHandlerUpdate(int Index, Microsoft.Maui.IMenuElement! MenuElement) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.get -> int +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.init -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.get -> Microsoft.Maui.IMenuElement! +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.init -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.PlatformView.get -> Microsoft.UI.Xaml.Controls.MenuFlyout! +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyout! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.PlatformView.get -> Microsoft.UI.Xaml.Controls.MenuFlyoutSeparator! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyoutSeparator! Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler() -> void Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.IContextFlyoutElement.ContextFlyout.get -> Microsoft.Maui.IFlyout? +Microsoft.Maui.IFlyout +Microsoft.Maui.IMenuFlyout +Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? @@ -13,10 +37,19 @@ Microsoft.Maui.ToolTip Microsoft.Maui.ToolTip.Content.get -> object? Microsoft.Maui.ToolTip.Content.set -> void Microsoft.Maui.ToolTip.ToolTip() -> void +override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> Microsoft.UI.Xaml.Controls.MenuFlyout! +override Microsoft.Maui.Handlers.MenuFlyoutHandler.SetVirtualView(Microsoft.Maui.IElement! view) -> void override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> Microsoft.UI.Xaml.Controls.MenuFlyoutSeparator! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapInsert(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.Mapper -> Microsoft.Maui.IPropertyMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapRemove(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.Mapper -> Microsoft.Maui.IPropertyMapper! override Microsoft.Maui.Handlers.EditorHandler.SetVirtualView(Microsoft.Maui.IView! view) -> void override Microsoft.Maui.Handlers.EntryHandler.SetVirtualView(Microsoft.Maui.IView! view) -> void static Microsoft.Maui.Handlers.ViewHandler.MapToolTip(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void static Microsoft.Maui.Platform.ViewExtensions.UpdateToolTip(this Microsoft.UI.Xaml.FrameworkElement! platformView, Microsoft.Maui.ToolTip? tooltip) -> void +static Microsoft.Maui.Handlers.ViewHandler.MapContextFlyout(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void diff --git a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt index 2eaa83fb7e2d..b79151b4b9d0 100644 --- a/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/net/PublicAPI.Unshipped.txt @@ -1,10 +1,34 @@ #nullable enable +Microsoft.Maui.Handlers.MenuFlyoutHandler +Microsoft.Maui.Handlers.MenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.ContextFlyoutItemHandlerUpdate(int Index, Microsoft.Maui.IMenuElement! MenuElement) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.get -> int +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.init -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.get -> Microsoft.Maui.IMenuElement! +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.init -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.PlatformView.get -> object! +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyout! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.PlatformView.get -> object! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyoutSeparator! Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler() -> void Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.IContextFlyoutElement.ContextFlyout.get -> Microsoft.Maui.IFlyout? +Microsoft.Maui.IFlyout +Microsoft.Maui.IMenuFlyout +Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? @@ -12,7 +36,15 @@ Microsoft.Maui.ToolTip Microsoft.Maui.ToolTip.Content.get -> object? Microsoft.Maui.ToolTip.Content.set -> void Microsoft.Maui.ToolTip.ToolTip() -> void +override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> object! override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> object! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapInsert(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.Mapper -> Microsoft.Maui.IPropertyMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapRemove(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.Mapper -> Microsoft.Maui.IPropertyMapper! static Microsoft.Maui.Handlers.ViewHandler.MapToolTip(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void +static Microsoft.Maui.Handlers.ViewHandler.MapContextFlyout(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void diff --git a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt index 2eaa83fb7e2d..9bbc76dc98f3 100644 --- a/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -1,10 +1,34 @@ #nullable enable +Microsoft.Maui.Handlers.MenuFlyoutHandler +Microsoft.Maui.Handlers.MenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.ContextFlyoutItemHandlerUpdate(int Index, Microsoft.Maui.IMenuElement! MenuElement) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.get -> int +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.init -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.get -> Microsoft.Maui.IMenuElement! +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.init -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.PlatformView.get -> object! +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyout! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.PlatformView.get -> object! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyoutSeparator! Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler() -> void Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.IContextFlyoutElement.ContextFlyout.get -> Microsoft.Maui.IFlyout? +Microsoft.Maui.IMenuFlyout +Microsoft.Maui.IFlyout +Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? @@ -12,7 +36,15 @@ Microsoft.Maui.ToolTip Microsoft.Maui.ToolTip.Content.get -> object? Microsoft.Maui.ToolTip.Content.set -> void Microsoft.Maui.ToolTip.ToolTip() -> void +override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> object! override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> object! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapInsert(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.Mapper -> Microsoft.Maui.IPropertyMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapRemove(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.Mapper -> Microsoft.Maui.IPropertyMapper! static Microsoft.Maui.Handlers.ViewHandler.MapToolTip(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void +static Microsoft.Maui.Handlers.ViewHandler.MapContextFlyout(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void diff --git a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt index 2eaa83fb7e2d..9bbc76dc98f3 100644 --- a/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt +++ b/src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt @@ -1,10 +1,34 @@ #nullable enable +Microsoft.Maui.Handlers.MenuFlyoutHandler +Microsoft.Maui.Handlers.MenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler() -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.MenuFlyoutHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.MenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.ContextFlyoutItemHandlerUpdate(int Index, Microsoft.Maui.IMenuElement! MenuElement) -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.get -> int +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.Index.init -> void +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.get -> Microsoft.Maui.IMenuElement! +Microsoft.Maui.Handlers.ContextFlyoutItemHandlerUpdate.MenuElement.init -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Add(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Clear() -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Insert(int index, Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.PlatformView.get -> object! +Microsoft.Maui.Handlers.IMenuFlyoutHandler.Remove(Microsoft.Maui.IMenuElement! view) -> void +Microsoft.Maui.Handlers.IMenuFlyoutHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyout! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.PlatformView.get -> object! Microsoft.Maui.Handlers.IMenuFlyoutSeparatorHandler.VirtualView.get -> Microsoft.Maui.IMenuFlyoutSeparator! Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler() -> void Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.MenuFlyoutSeparatorHandler(Microsoft.Maui.IPropertyMapper! mapper, Microsoft.Maui.CommandMapper? commandMapper = null) -> void +Microsoft.Maui.IContextFlyoutElement.ContextFlyout.get -> Microsoft.Maui.IFlyout? +Microsoft.Maui.IMenuFlyout +Microsoft.Maui.IFlyout +Microsoft.Maui.IContextFlyoutElement Microsoft.Maui.IMenuFlyoutSeparator Microsoft.Maui.IToolTipElement Microsoft.Maui.IToolTipElement.ToolTip.get -> Microsoft.Maui.ToolTip? @@ -12,7 +36,15 @@ Microsoft.Maui.ToolTip Microsoft.Maui.ToolTip.Content.get -> object? Microsoft.Maui.ToolTip.Content.set -> void Microsoft.Maui.ToolTip.ToolTip() -> void +override Microsoft.Maui.Handlers.MenuFlyoutHandler.CreatePlatformElement() -> object! override Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CreatePlatformElement() -> object! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.CommandMapper -> Microsoft.Maui.CommandMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapAdd(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapClear(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapInsert(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void +static Microsoft.Maui.Handlers.MenuFlyoutHandler.Mapper -> Microsoft.Maui.IPropertyMapper! +static Microsoft.Maui.Handlers.MenuFlyoutHandler.MapRemove(Microsoft.Maui.Handlers.IMenuFlyoutHandler! handler, Microsoft.Maui.IMenuFlyout! menuElement, object? arg) -> void static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.CommandMapper -> Microsoft.Maui.CommandMapper! static Microsoft.Maui.Handlers.MenuFlyoutSeparatorHandler.Mapper -> Microsoft.Maui.IPropertyMapper! static Microsoft.Maui.Handlers.ViewHandler.MapToolTip(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void +static Microsoft.Maui.Handlers.ViewHandler.MapContextFlyout(Microsoft.Maui.IViewHandler! handler, Microsoft.Maui.IView! view) -> void