diff --git a/src/Compatibility/Core/src/Android/AppCompat/CarouselPageRenderer.cs b/src/Compatibility/Core/src/Android/AppCompat/CarouselPageRenderer.cs deleted file mode 100644 index 5400e5c981cb..000000000000 --- a/src/Compatibility/Core/src/Android/AppCompat/CarouselPageRenderer.cs +++ /dev/null @@ -1,198 +0,0 @@ -using System.Collections.Specialized; -using System.ComponentModel; -using Android.Content; -using Android.Views; -using AndroidX.Fragment.App; -using AndroidX.ViewPager.Widget; -using Microsoft.Maui.Controls.Platform; -using Microsoft.Maui.Graphics; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.Android.AppCompat -{ - [System.Obsolete] - internal class CarouselPageRenderer : VisualElementRenderer, ViewPager.IOnPageChangeListener, IManageFragments - { - bool _disposed; - FormsViewPager _viewPager; - Page _previousPage; - FragmentManager _fragmentManager; - - public CarouselPageRenderer(Context context) : base(context) - { - AutoPackage = false; - } - - void ViewPager.IOnPageChangeListener.OnPageScrolled(int position, float positionOffset, int positionOffsetPixels) - { - } - - void ViewPager.IOnPageChangeListener.OnPageScrollStateChanged(int state) - { - } - - IPageController PageController => Element as IPageController; - - FragmentManager FragmentManager => _fragmentManager ?? (_fragmentManager = Context.GetFragmentManager()); - - ViewGroup ViewGroup => ((IVisualElementRenderer)this).View as ViewGroup; - - void IManageFragments.SetFragmentManager(FragmentManager childFragmentManager) - { - if (_fragmentManager == null) - _fragmentManager = childFragmentManager; - } - - void ViewPager.IOnPageChangeListener.OnPageSelected(int position) - { - Element.CurrentPage = Element.Children[position]; - if (_previousPage != Element.CurrentPage) - { - _previousPage?.SendDisappearing(); - _previousPage = Element.CurrentPage; - } - Element.CurrentPage.SendAppearing(); - } - - protected override void Dispose(bool disposing) - { - if (disposing && !_disposed) - { - _disposed = true; - - if (Element != null) - PageController.InternalChildren.CollectionChanged -= OnChildrenCollectionChanged; - - if (_viewPager != null) - { - RemoveView(_viewPager); - - _viewPager.ClearOnPageChangeListeners(); - _viewPager.Adapter.Dispose(); - _viewPager.Dispose(); - _viewPager = null; - } - - RemoveAllViews(); - - _previousPage = null; - _fragmentManager = null; - - if (Element?.Children != null) - { - foreach (ContentPage pageToRemove in Element.Children) - { - IVisualElementRenderer pageRenderer = Platform.GetRenderer(pageToRemove); - if (pageRenderer != null) - { - pageRenderer.View.RemoveFromParent(); - pageRenderer.Dispose(); - } - - pageToRemove.ClearValue(Platform.RendererProperty); - } - } - } - - base.Dispose(disposing); - } - - protected override void OnAttachedToWindow() - { - base.OnAttachedToWindow(); - if (Parent is PageContainer pageContainer && (pageContainer.IsInFragment || pageContainer.Visibility == ViewStates.Gone)) - return; - PageController.SendAppearing(); - Element.CurrentPage?.SendAppearing(); - } - - protected override void OnDetachedFromWindow() - { - base.OnDetachedFromWindow(); - if (Parent is PageContainer pageContainer && pageContainer.IsInFragment) - return; - Element.CurrentPage?.SendDisappearing(); - PageController.SendDisappearing(); - } - - protected override void OnElementChanged(ElementChangedEventArgs e) - { - base.OnElementChanged(e); - - var activity = Context.GetActivity(); - - if (e.OldElement != null) - ((IPageController)e.OldElement).InternalChildren.CollectionChanged -= OnChildrenCollectionChanged; - - if (e.NewElement != null) - { - if (_viewPager != null) - { - _viewPager.RemoveOnPageChangeListener(this); - - ViewGroup.RemoveView(_viewPager); - - _viewPager.Dispose(); - } - - FormsViewPager pager = _viewPager = new FormsViewPager(activity) - { - OverScrollMode = OverScrollMode.Never, - EnableGesture = true, - LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent), - Adapter = new FormsFragmentPagerAdapter(e.NewElement, FragmentManager) { CountOverride = e.NewElement.Children.Count } - }; - pager.Id = Platform.GenerateViewId(); - pager.AddOnPageChangeListener(this); - - ViewGroup.AddView(pager); - CarouselPage carouselPage = e.NewElement; - if (carouselPage.CurrentPage != null) - { - _previousPage = carouselPage.CurrentPage; - ScrollToCurrentPage(); - } - - ((IPageController)carouselPage).InternalChildren.CollectionChanged += OnChildrenCollectionChanged; - } - } - - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) - { - base.OnElementPropertyChanged(sender, e); - - if (e.PropertyName == nameof(Element.CurrentPage)) - ScrollToCurrentPage(); - } - - protected override void OnLayout(bool changed, int l, int t, int r, int b) - { - FormsViewPager pager = _viewPager; - Context context = Context; - int width = r - l; - int height = b - t; - - pager.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.AtMost), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.AtMost)); - - if (width > 0 && height > 0) - { - PageController.ContainerArea = new Rect(0, 0, context.FromPixels(width), context.FromPixels(height)); - pager.Layout(0, 0, width, b); - } - - base.OnLayout(changed, l, t, r, b); - } - - void OnChildrenCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - FormsViewPager pager = _viewPager; - - ((FormsFragmentPagerAdapter)pager.Adapter).CountOverride = Element.Children.Count; - pager.Adapter.NotifyDataSetChanged(); - } - - void ScrollToCurrentPage() - { - _viewPager.SetCurrentItem(Element.Children.IndexOf(Element.CurrentPage), true); - } - } -} diff --git a/src/Compatibility/Core/src/Android/Renderers/CarouselPageAdapter.cs b/src/Compatibility/Core/src/Android/Renderers/CarouselPageAdapter.cs deleted file mode 100644 index ab71e31243da..000000000000 --- a/src/Compatibility/Core/src/Android/Renderers/CarouselPageAdapter.cs +++ /dev/null @@ -1,161 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Linq; -using Android.Content; -using Android.Views; -using AndroidX.Core.View; -using AndroidX.ViewPager.Widget; -using Microsoft.Maui.Controls.Internals; -using Microsoft.Maui.Controls.Platform; -using Object = Java.Lang.Object; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.Android -{ - [Obsolete] - internal class CarouselPageAdapter : PagerAdapter, ViewPager.IOnPageChangeListener - { - readonly Context _context; - readonly ViewPager _pager; - bool _ignoreAndroidSelection; - CarouselPage _page; - - IElementController ElementController => _page as IElementController; - - public CarouselPageAdapter(ViewPager pager, CarouselPage page, Context context) - { - _pager = pager; - _page = page; - _context = context; - - page.PagesChanged += OnPagesChanged; - } - - public override int Count - { - get { return _page.Children.Count(); } - } - - public void OnPageScrolled(int position, float positionOffset, int positionOffsetPixels) - { - } - - public void OnPageScrollStateChanged(int state) - { - } - - public void OnPageSelected(int position) - { - if (_ignoreAndroidSelection) - return; - - int currentItem = _pager.CurrentItem; - _page.CurrentPage = currentItem >= 0 && currentItem < ElementController.LogicalChildren.Count ? ElementController.LogicalChildren[currentItem] as ContentPage : null; - } - - public override void DestroyItem(ViewGroup p0, int p1, Object p2) - { - var holder = (ObjectJavaBox>)p2; - Page destroyedPage = holder.Instance.Item2; - - IVisualElementRenderer renderer = Platform.GetRenderer(destroyedPage); - renderer.View.RemoveFromParent(); - holder.Instance.Item1.RemoveFromParent(); - } - - public override int GetItemPosition(Object item) - { - // The int is the current index. - var holder = (ObjectJavaBox>)item; - Element parent = holder.Instance.Item2.RealParent; - if (parent == null) - return PositionNone; - - // Unfortunately we can't just call CarouselPage.GetIndex, because we need to know - // if the item has been removed. We could update MultiPage to set removed items' index - // to -1 to support this if it ever becomes an issue. - int index = ((CarouselPage)parent).Children.IndexOf(holder.Instance.Item2); - if (index == -1) - return PositionNone; - - if (index != holder.Instance.Item3) - { - holder.Instance = new Tuple(holder.Instance.Item1, holder.Instance.Item2, index); - return index; - } - - return PositionUnchanged; - } - - public override Object InstantiateItem(ViewGroup container, int position) - { - ContentPage child = _page.Children.ElementAt(position); - if (Platform.GetRenderer(child) == null) - Platform.SetRenderer(child, Platform.CreateRenderer(child, _context)); - - IVisualElementRenderer renderer = Platform.GetRenderer(child); - renderer.View.RemoveFromParent(); - - ViewGroup frame = new PageContainer(_context, renderer); - - container.AddView(frame); - - return new ObjectJavaBox>(new Tuple(frame, child, position)); - } - - public override bool IsViewFromObject(global::Android.Views.View p0, Object p1) - { - var holder = (ObjectJavaBox>)p1; - ViewGroup frame = holder.Instance.Item1; - return p0 == frame; - } - - public void UpdateCurrentItem() - { - if (_page.CurrentPage == null) - throw new InvalidOperationException("CarouselPage has no children."); - - int index = CarouselPage.GetIndex(_page.CurrentPage); - if (index >= 0 && index < _page.Children.Count) - _pager.CurrentItem = index; - } - - protected override void Dispose(bool disposing) - { - if (disposing && _page != null) - { - foreach (Element element in ElementController.LogicalChildren) - { - var childPage = element as VisualElement; - - if (childPage == null) - continue; - - IVisualElementRenderer childPageRenderer = Platform.GetRenderer(childPage); - if (childPageRenderer != null) - { - childPageRenderer.View.RemoveFromParent(); - childPageRenderer.Dispose(); - Platform.SetRenderer(childPage, null); - } - } - _page.PagesChanged -= OnPagesChanged; - _page = null; - } - base.Dispose(disposing); - } - - void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e) - { - _ignoreAndroidSelection = true; - - NotifyDataSetChanged(); - - _ignoreAndroidSelection = false; - - if (_page.CurrentPage == null) - return; - - UpdateCurrentItem(); - } - } -} diff --git a/src/Compatibility/Core/src/Windows/CarouselPageRenderer.cs b/src/Compatibility/Core/src/Windows/CarouselPageRenderer.cs deleted file mode 100644 index ffb354eee54e..000000000000 --- a/src/Compatibility/Core/src/Windows/CarouselPageRenderer.cs +++ /dev/null @@ -1,188 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.ComponentModel; -using Microsoft.Maui.Controls.Internals; -using Microsoft.Maui.Controls.Platform; -using Microsoft.Maui.Graphics; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using WSelectionChangedEventArgs = Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.UWP -{ - internal partial class CarouselPageRenderer : FlipView, IVisualElementRenderer - { - bool _fromUpdate; - bool _disposed; - - BackgroundTracker _tracker; - - public CarouselPageRenderer() - { - VirtualizingStackPanel.SetVirtualizationMode(this, VirtualizationMode.Standard); - ItemTemplate = (Microsoft.UI.Xaml.DataTemplate)Microsoft.UI.Xaml.Application.Current.Resources["ContainedPageTemplate"]; - SelectionChanged += OnSelectionChanged; - Loaded += OnLoaded; - Unloaded += OnUnloaded; - } - - public CarouselPage Element { get; private set; } - - public void Dispose() - { - Dispose(true); - } - - public FrameworkElement ContainerElement - { - get { return this; } - } - - VisualElement IVisualElementRenderer.Element - { - get { return Element; } - } - - Page Page => Element as Page; - - public event EventHandler ElementChanged; - - public SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint) - { - var constraint = new global::Windows.Foundation.Size(widthConstraint, heightConstraint); - - double oldWidth = Width; - double oldHeight = Height; - - Height = double.NaN; - Width = double.NaN; - - Measure(constraint); - var result = new Size(Math.Ceiling(DesiredSize.Width), Math.Ceiling(DesiredSize.Height)); - - Width = oldWidth; - Height = oldHeight; - - return new SizeRequest(result); - } - - UIElement IVisualElementRenderer.GetNativeElement() - { - return null; - } - - public void SetElement(VisualElement element) - { - var newPage = element as CarouselPage; - if (element != null && newPage == null) - throw new ArgumentException("element must be a CarouselPage"); - - CarouselPage oldPage = Element; - Element = newPage; - - if (oldPage != null) - { - oldPage.SendDisappearing(); - ((INotifyCollectionChanged)oldPage.Children).CollectionChanged -= OnChildrenChanged; - oldPage.PropertyChanged -= OnElementPropertyChanged; - } - - if (newPage != null) - { - if (_tracker == null) - { - _tracker = new BackgroundTracker(BackgroundProperty) { Control = this, Container = this }; - } - - _tracker.Element = newPage; - - // Adding Items triggers the SelectionChanged event, - // which will reset the CurrentPage unless we tell it to ignore. - _fromUpdate = true; - for (var i = 0; i < newPage.Children.Count; i++) - Items.Add(newPage.Children[i]); - _fromUpdate = false; - - ((INotifyCollectionChanged)newPage.Children).CollectionChanged += OnChildrenChanged; - newPage.PropertyChanged += OnElementPropertyChanged; - - UpdateCurrentPage(); - newPage.SendAppearing(); - } - - OnElementChanged(new ElementChangedEventArgs(oldPage, newPage)); - - if (!string.IsNullOrEmpty(Element?.AutomationId)) - SetValue(Microsoft.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, Element.AutomationId); - } - - protected virtual void Dispose(bool disposing) - { - if (!disposing || _disposed) - return; - - if (_tracker != null) - { - _tracker.Dispose(); - _tracker = null; - } - - _disposed = true; - Page?.SendDisappearing(); - SetElement(null); - } - - protected virtual void OnElementChanged(ElementChangedEventArgs e) - { - EventHandler changed = ElementChanged; - if (changed != null) - changed(this, new VisualElementChangedEventArgs(e.OldElement, e.NewElement)); - } - - protected virtual void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == "CurrentPage") - { - UpdateCurrentPage(); - } - } - - void OnChildrenChanged(object sender, NotifyCollectionChangedEventArgs e) - { - e.Apply(Element.Children, Items); - } - - void OnLoaded(object sender, RoutedEventArgs e) - { - Page?.SendAppearing(); - } - - void OnSelectionChanged(object sender, WSelectionChangedEventArgs e) - { - if (_fromUpdate) - return; - - var page = (ContentPage)SelectedItem; - ContentPage currentPage = Element.CurrentPage; - if (currentPage == page) - return; - currentPage?.SendDisappearing(); - Element.CurrentPage = page; - page?.SendAppearing(); - } - - void OnUnloaded(object sender, RoutedEventArgs e) - { - Page?.SendDisappearing(); - } - - void UpdateCurrentPage() - { - _fromUpdate = true; - - SelectedItem = Element.CurrentPage; - - _fromUpdate = false; - } - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/Windows/HandlerToRendererShim.cs b/src/Compatibility/Core/src/Windows/HandlerToRendererShim.cs index 61821e5f7c32..9846dab67226 100644 --- a/src/Compatibility/Core/src/Windows/HandlerToRendererShim.cs +++ b/src/Compatibility/Core/src/Windows/HandlerToRendererShim.cs @@ -89,7 +89,7 @@ void NativeViewLoaded(object sender, RoutedEventArgs e) // Unfortunately, the layout and its children will have cached their previous measurement results // So we need to iterate over the children and force them to clear their caches so they'll call // the native measurement methods again now that measurement is a valid thing to do. - foreach (var child in layout.Children) + foreach (var child in layout.InternalChildren) { if (child is VisualElement ve) { diff --git a/src/Compatibility/Core/src/Windows/PageRenderer.cs b/src/Compatibility/Core/src/Windows/PageRenderer.cs index 760e19852d15..9c9cd4700ed1 100644 --- a/src/Compatibility/Core/src/Windows/PageRenderer.cs +++ b/src/Compatibility/Core/src/Windows/PageRenderer.cs @@ -76,11 +76,6 @@ protected override void OnElementChanged(ElementChangedEventArgs e) void OnLoaded(object sender, RoutedEventArgs args) { - var carouselPage = Element?.Parent as CarouselPage; - if (carouselPage != null && carouselPage.Children[0] != Element) - { - return; - } _loaded = true; Unloaded += OnUnloaded; Element?.SendAppearing(); diff --git a/src/Compatibility/Core/src/iOS/Renderers/CarouselPageRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/CarouselPageRenderer.cs deleted file mode 100644 index 6d3514a6aa8a..000000000000 --- a/src/Compatibility/Core/src/iOS/Renderers/CarouselPageRenderer.cs +++ /dev/null @@ -1,412 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Runtime.Versioning; -using Microsoft.Maui.Controls.Internals; -using Microsoft.Maui.Controls.Platform; -using Microsoft.Maui.Graphics; -using ObjCRuntime; -using UIKit; -using PointF = CoreGraphics.CGPoint; -using RectangleF = CoreGraphics.CGRect; -using SizeF = CoreGraphics.CGSize; - -namespace Microsoft.Maui.Controls.Compatibility.Platform.iOS -{ - [System.Obsolete(Compatibility.Hosting.MauiAppBuilderExtensions.UseMapperInstead)] - internal class CarouselPageRenderer : UIViewController, IVisualElementRenderer - { - bool _appeared; - Dictionary _containerMap; - bool _disposed; - bool _ignoreNativeScrolling; - UIScrollView _scrollView; - VisualElementTracker _tracker; - Page _previousPage; - - [Preserve(Conditional = true)] - public CarouselPageRenderer() - { - } - - IElementController ElementController => Element as IElementController; - - - protected CarouselPage Carousel - { - get { return (CarouselPage)Element; } - } - - IPageController PageController => (IPageController)Element; - - protected int SelectedIndex - { - get { return (int)(_scrollView.ContentOffset.X / _scrollView.Frame.Width); } - set { ScrollToPage(value); } - } - - public VisualElement Element { get; private set; } - - public event EventHandler ElementChanged; - - public SizeRequest GetDesiredSize(double widthConstraint, double heightConstraint) - { - return NativeView.GetSizeRequest(widthConstraint, heightConstraint); - } - - public UIView NativeView - { - get { return View; } - } - - public void SetElement(VisualElement element) - { - VisualElement oldElement = Element; - Element = element; - _containerMap = new Dictionary(); - - OnElementChanged(new VisualElementChangedEventArgs(oldElement, element)); - - if (element != null) - element.SendViewInitialized(NativeView); - - _previousPage = Carousel?.CurrentPage; - } - - public void SetElementSize(Size size) - { - Element.Layout(new Rect(Element.X, Element.Y, size.Width, size.Height)); - } - - public UIViewController ViewController - { - get { return this; } - } - - public override void DidRotate(UIInterfaceOrientation fromInterfaceOrientation) - { - _ignoreNativeScrolling = false; - View.SetNeedsLayout(); - } - - public override void ViewDidAppear(bool animated) - { - base.ViewDidAppear(animated); - - if (_appeared || _disposed) - return; - - _appeared = true; - PageController.SendAppearing(); - } - - public override void ViewDidDisappear(bool animated) - { - base.ViewDidDisappear(animated); - - if (!_appeared || _disposed) - return; - - _appeared = false; - PageController.SendDisappearing(); - } - - public override void ViewDidLayoutSubviews() - { - base.ViewDidLayoutSubviews(); - - View.Frame = View.Superview.Bounds; - _scrollView.Frame = View.Bounds; - - PositionChildren(); - UpdateCurrentPage(false); - } - - public override void ViewDidLoad() - { - base.ViewDidLoad(); - - _tracker = new VisualElementTracker(this); - - _scrollView = new UIScrollView { ShowsHorizontalScrollIndicator = false }; - - _scrollView.DecelerationEnded += OnDecelerationEnded; - - UpdateBackground(); - - View.Add(_scrollView); - - for (var i = 0; i < ElementController.LogicalChildren.Count; i++) - { - Element element = ElementController.LogicalChildren[i]; - var child = element as ContentPage; - if (child != null) - InsertPage(child, i); - } - - PositionChildren(); - - Carousel.PropertyChanged += OnPropertyChanged; - Carousel.PagesChanged += OnPagesChanged; - } - - [UnsupportedOSPlatform("tvos")] - [UnsupportedOSPlatform("ios6.0")] - public override void ViewDidUnload() - { - base.ViewDidUnload(); - - if (_scrollView != null) - _scrollView.DecelerationEnded -= OnDecelerationEnded; - - if (Carousel != null) - { - Carousel.PropertyChanged -= OnPropertyChanged; - Carousel.PagesChanged -= OnPagesChanged; - } - } - - public override void WillRotate(UIInterfaceOrientation toInterfaceOrientation, double duration) - { - _ignoreNativeScrolling = true; - } - - protected override void Dispose(bool disposing) - { - if (disposing && !_disposed) - { - _previousPage = null; - - if (_scrollView != null) - _scrollView.DecelerationEnded -= OnDecelerationEnded; - - if (Carousel != null) - { - Carousel.PropertyChanged -= OnPropertyChanged; - Carousel.PagesChanged -= OnPagesChanged; - } - - Platform.SetRenderer(Element, null); - - Clear(); - - if (_scrollView != null) - { - _scrollView.DecelerationEnded -= OnDecelerationEnded; - _scrollView.RemoveFromSuperview(); - _scrollView = null; - } - - if (_appeared) - { - _appeared = false; - PageController?.SendDisappearing(); - } - - if (_tracker != null) - { - _tracker.Dispose(); - _tracker = null; - } - - Element = null; - _disposed = true; - } - - base.Dispose(disposing); - } - - protected virtual void OnElementChanged(VisualElementChangedEventArgs e) - { - EventHandler changed = ElementChanged; - if (changed != null) - changed(this, e); - } - - void Clear() - { - foreach (KeyValuePair kvp in _containerMap) - { - kvp.Value.RemoveFromSuperview(); - IVisualElementRenderer renderer = Platform.GetRenderer(kvp.Key); - if (renderer != null) - { - renderer.ViewController.RemoveFromParentViewController(); - renderer.NativeView.RemoveFromSuperview(); - Platform.SetRenderer(kvp.Key, null); - } - } - _containerMap.Clear(); - } - - void InsertPage(ContentPage page, int index) - { - IVisualElementRenderer renderer = Platform.GetRenderer(page); - if (renderer == null) - { - renderer = Platform.CreateRenderer(page); - Platform.SetRenderer(page, renderer); - } - - UIView container = new CarouselPageContainer(page); - - UIView view = renderer.NativeView; - - container.AddSubview(view); - _containerMap[page] = container; - - AddChildViewController(renderer.ViewController); - _scrollView.InsertSubview(container, index); - - if ((index == 0 && SelectedIndex == 0) || (index < SelectedIndex)) - ScrollToPage(SelectedIndex + 1, false); - } - - void OnDecelerationEnded(object sender, EventArgs eventArgs) - { - if (_ignoreNativeScrolling || SelectedIndex >= ElementController.LogicalChildren.Count) - return; - - var currentPage = (ContentPage)ElementController.LogicalChildren[SelectedIndex]; - if (_previousPage != currentPage) - { - _previousPage?.SendDisappearing(); - _previousPage = currentPage; - } - Carousel.CurrentPage = currentPage; - currentPage.SendAppearing(); - } - - void OnPagesChanged(object sender, NotifyCollectionChangedEventArgs e) - { - _ignoreNativeScrolling = true; - - NotifyCollectionChangedAction action = e.Apply((o, i, c) => InsertPage((ContentPage)o, i), (o, i) => RemovePage((ContentPage)o, i), Reset); - PositionChildren(); - - _ignoreNativeScrolling = false; - - if (action == NotifyCollectionChangedAction.Reset) - { - int index = Carousel.CurrentPage != null ? CarouselPage.GetIndex(Carousel.CurrentPage) : 0; - if (index < 0) - index = 0; - - ScrollToPage(index); - } - } - - void OnPropertyChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == "CurrentPage") - UpdateCurrentPage(); - else if (e.PropertyName == VisualElement.BackgroundColorProperty.PropertyName || e.PropertyName == VisualElement.BackgroundProperty.PropertyName) - UpdateBackground(); - else if (e.PropertyName == Page.BackgroundImageSourceProperty.PropertyName) - UpdateBackground(); - } - - void PositionChildren() - { - nfloat x = 0; - RectangleF bounds = View.Bounds; - foreach (ContentPage child in ((CarouselPage)Element).Children) - { - UIView container = _containerMap[child]; - - container.Frame = new RectangleF(x, bounds.Y, bounds.Width, bounds.Height); - x += bounds.Width; - } - - _scrollView.PagingEnabled = true; - _scrollView.ContentSize = new SizeF(bounds.Width * ((CarouselPage)Element).Children.Count, bounds.Height); - } - - void RemovePage(ContentPage page, int index) - { - UIView container = _containerMap[page]; - container.RemoveFromSuperview(); - _containerMap.Remove(page); - - IVisualElementRenderer renderer = Platform.GetRenderer(page); - if (renderer == null) - return; - - renderer.ViewController.RemoveFromParentViewController(); - renderer.NativeView.RemoveFromSuperview(); - } - - void Reset() - { - Clear(); - - for (var i = 0; i < ElementController.LogicalChildren.Count; i++) - { - Element element = ElementController.LogicalChildren[i]; - var child = element as ContentPage; - if (child != null) - InsertPage(child, i); - } - } - - void ScrollToPage(int index, bool animated = true) - { - if (_scrollView.ContentOffset.X == index * _scrollView.Frame.Width) - return; - - _scrollView.SetContentOffset(new PointF(index * _scrollView.Frame.Width, 0), animated); - } - - void UpdateBackground() - { - this.ApplyNativeImageAsync(Page.BackgroundImageSourceProperty, bgImage => - { - if (bgImage != null) - View.BackgroundColor = UIColor.FromPatternImage(bgImage); - else if (Element.BackgroundColor == null) - View.BackgroundColor = ColorExtensions.BackgroundColor; - else - { - if (Element.BackgroundColor == null) - View.BackgroundColor = UIColor.White; - else - View.BackgroundColor = Element.BackgroundColor.ToPlatform(); - - Brush background = Element.Background; - View.UpdateBackground(background); - } - }); - } - - void UpdateCurrentPage(bool animated = true) - { - ContentPage current = Carousel.CurrentPage; - if (current != null) - ScrollToPage(CarouselPage.GetIndex(current), animated); - } - - class CarouselPageContainer : UIView - { - public CarouselPageContainer(VisualElement element) - { - Element = element; - } - - public VisualElement Element { get; } - - public override void LayoutSubviews() - { - base.LayoutSubviews(); - - if (Subviews.Length > 0) - Subviews[0].Frame = new RectangleF(0, 0, (float)Element.Width, (float)Element.Height); - } - } - - public void RegisterEffect(Effect effect) - { - VisualElementRenderer.RegisterEffect(effect, View); - } - } -} \ No newline at end of file diff --git a/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs index ff020b55bfbb..ce5ecd62564e 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs @@ -163,9 +163,6 @@ public override void ViewDidAppear(bool animated) if (OperatingSystem.IsIOSVersionAtLeast(11)) SetNeedsUpdateOfHomeIndicatorAutoHidden(); - if (Element.Parent is CarouselPage) - return; - Page.SendAppearing(); } @@ -178,9 +175,6 @@ public override void ViewDidDisappear(bool animated) _appeared = false; - if (Element.Parent is CarouselPage) - return; - Page.SendDisappearing(); } diff --git a/src/Controls/docs/Microsoft.Maui.Controls/ContentPresenter.xml b/src/Controls/docs/Microsoft.Maui.Controls/ContentPresenter.xml deleted file mode 100644 index 74d1ddc7ce07..000000000000 --- a/src/Controls/docs/Microsoft.Maui.Controls/ContentPresenter.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - Microsoft.Maui.Controls.Core - 0.0.0.0 - 2.0.0.0 - - - Microsoft.Maui.Controls.Layout - - - - Layout manager for templated views. - - - - - - - Constructor - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - - Creates a new empty with default values - - - - - - - - Property - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - Microsoft.Maui.Controls.View - - - Gets or sets the view whose layout is managed by this . - - - - - - - - Field - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - Microsoft.Maui.Controls.BindableProperty - - - Backing store for the property. - - - - - - - - Method - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - System.Void - - - - - - - - - The X coordinate of the upper left corner of the layout rectangle. - The Y coordinate of the upper left corner of the layout rectangle. - The width of the layout rectangle. - The height of the layout rectangle. - Lays out the children of the property within the rectangle that is defined by , , , and . - - - - - - - - Method - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - - System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never) - - - System.Obsolete("OnSizeRequest is obsolete as of version 2.2.0. Please use OnMeasure instead.") - - - - Microsoft.Maui.SizeRequest - - - - - - - The width constraint of the size request. - The width constraint of the size request. - Method that is raised when a size request is made. - - - - diff --git a/src/Controls/docs/Microsoft.Maui.Controls/TemplatedView.xml b/src/Controls/docs/Microsoft.Maui.Controls/TemplatedView.xml deleted file mode 100644 index 48adb2f8984e..000000000000 --- a/src/Controls/docs/Microsoft.Maui.Controls/TemplatedView.xml +++ /dev/null @@ -1,232 +0,0 @@ - - - - - - - Microsoft.Maui.Controls.Core - 0.0.0.0 - 2.0.0.0 - - - Microsoft.Maui.Controls.Layout - - - - A view that displays content with a control template, and the base class for . - - - - - - - Constructor - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - - Creates a new empty templated view. - - - - - - - - Property - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - Microsoft.Maui.Controls.ControlTemplate - - - Gets or sets the control template that is used to display content. - - - - - - - - Field - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - Microsoft.Maui.Controls.BindableProperty - - - Backing store for the property. - - - - - - - - Method - - Microsoft.Maui.Controls.Core - 2.0.0.0 - - - System.Object - - - - - - To be added. - - - - - - - - Method - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - System.Void - - - - - - - - - The X coordinate of the upper left corner of the bounding rectangle. - The Y coordinate of the upper left corner of the bounding rectangle. - The width of the bounding rectangle. - The height of the bounding rectangle. - Positions and sizes the children of the templated view within the rectangle defined by , , , and T. - - - - - - - - Method - - Microsoft.Maui.Controls.Core - 2.0.0.0 - - - System.Void - - - - - - - - - - - Method - - Microsoft.Maui.Controls.Core - 2.0.0.0 - - - - System.Obsolete("OnChildRemoved(Element) is obsolete as of version 4.8.0. Please use OnChildRemoved(Element, int) instead.") - - - - System.Void - - - - - - To be added. - - - - - - - - Method - - Microsoft.Maui.Controls.Core - 2.0.0.0 - - - System.Void - - - - - - - To be added. - To be added. - - - - - - - - Method - - 0.0.0.0 - 2.0.0.0 - Microsoft.Maui.Controls.Core - - - - System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never) - - - System.Obsolete("OnSizeRequest is obsolete as of version 2.2.0. Please use OnMeasure instead.") - - - - Microsoft.Maui.SizeRequest - - - - - - - The width constraint that was passed with the request. - The height constraint that was passed with the request. - Method that is called when the layout updates. - - - - - - - - Method - - Microsoft.Maui.Controls.Core - 2.0.0.0 - - - Microsoft.Maui.Controls.ControlTemplate - - - - - - - diff --git a/src/Controls/src/Core/CarouselPage/CarouselPage.cs b/src/Controls/src/Core/CarouselPage/CarouselPage.cs deleted file mode 100644 index 8500a125fdda..000000000000 --- a/src/Controls/src/Core/CarouselPage/CarouselPage.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable disable -using System; - -namespace Microsoft.Maui.Controls -{ - [ContentProperty(nameof(Children))] - internal class CarouselPage : MultiPage, IElementConfiguration - { - readonly Lazy> _platformConfigurationRegistry; - - /// - public CarouselPage() - { - _platformConfigurationRegistry = new Lazy>(() => new PlatformConfigurationRegistry(this)); - } - - /// - public new IPlatformElementConfiguration On() where T : IConfigPlatform - { - return _platformConfigurationRegistry.Value.On(); - } - - protected override ContentPage CreateDefault(object item) - { - var page = new ContentPage(); - if (item != null) - page.Title = item.ToString(); - - return page; - } - } -} \ No newline at end of file diff --git a/src/Controls/src/Core/ClippedToBoundsElement.cs b/src/Controls/src/Core/ClippedToBoundsElement.cs new file mode 100644 index 000000000000..44f0f25f94d1 --- /dev/null +++ b/src/Controls/src/Core/ClippedToBoundsElement.cs @@ -0,0 +1,16 @@ +namespace Microsoft.Maui.Controls; + +static class ClippedToBoundsElement +{ + public static readonly BindableProperty IsClippedToBoundsProperty = + BindableProperty.Create("IsClippedToBounds", typeof(bool), typeof(IClippedToBoundsElement), false, + propertyChanged: IsClippedToBoundsPropertyChanged); + + static void IsClippedToBoundsPropertyChanged(BindableObject bindable, object oldValue, object newValue) + { + if (bindable is IView view) + { + view.Handler?.UpdateValue(nameof(Maui.ILayout.ClipsToBounds)); + } + } +} diff --git a/src/Controls/src/Core/Compatibility/Handlers/FlyoutPage/iOS/PhoneFlyoutPageRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/FlyoutPage/iOS/PhoneFlyoutPageRenderer.cs index 67816eb67274..15330f14b416 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/FlyoutPage/iOS/PhoneFlyoutPageRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/FlyoutPage/iOS/PhoneFlyoutPageRenderer.cs @@ -110,9 +110,9 @@ public void SetElement(VisualElement element) Element.SizeChanged += PageOnSizeChanged; } + [Obsolete] public void SetElementSize(Size size) { - Element.Layout(new Rect(Element.X, Element.Y, size.Width, size.Height)); } public UIViewController ViewController diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellRenderer.cs index 059e7a91a15a..4568795b1fef 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellRenderer.cs @@ -131,9 +131,9 @@ public void SetElement(VisualElement element) Mapper.UpdateProperties(this, Element); } + [Obsolete] public virtual void SetElementSize(Size size) { - Element.Layout(new Rect(Element.X, Element.Y, size.Width, size.Height)); } public override void ViewDidLayoutSubviews() @@ -141,8 +141,6 @@ public override void ViewDidLayoutSubviews() base.ViewDidLayoutSubviews(); if (_currentShellItemRenderer != null) _currentShellItemRenderer.ViewController.View.Frame = View.Bounds; - - SetElementSize(new Size(View.Bounds.Width, View.Bounds.Height)); } public override void ViewDidLoad() diff --git a/src/Controls/src/Core/ContentPresenter.cs b/src/Controls/src/Core/ContentPresenter.cs index 871aa3f27cc7..8499dfb51281 100644 --- a/src/Controls/src/Core/ContentPresenter.cs +++ b/src/Controls/src/Core/ContentPresenter.cs @@ -1,22 +1,26 @@ #nullable disable using System; +using System.Collections.Generic; using System.ComponentModel; -using Microsoft.Maui.Controls.Internals; using Microsoft.Maui.Graphics; using Microsoft.Maui.Layouts; namespace Microsoft.Maui.Controls { - /// + /// + /// Layout manager for templated views. + /// #pragma warning disable CS0618 // Type or member is obsolete - public class ContentPresenter : Compatibility.Layout, IContentView + public class ContentPresenter : Compatibility.Layout, ILayout, ILayoutController, IPaddingElement, IView, IVisualTreeElement, IInputTransparentContainerElement, IContentView #pragma warning restore CS0618 // Type or member is obsolete { - /// + /// Bindable property for . public static BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(ContentPresenter), null, propertyChanged: OnContentChanged); - /// + /// + /// Creates a new empty with default values. + /// public ContentPresenter() { this.SetBinding( @@ -27,7 +31,19 @@ public ContentPresenter() converterParameter: this); } - /// + /// Bindable property for . + public new static readonly BindableProperty CascadeInputTransparentProperty = InputTransparentContainerElement.CascadeInputTransparentProperty; + + /// + public new bool CascadeInputTransparent + { + get => (bool)GetValue(InputTransparentContainerElement.CascadeInputTransparentProperty); + set => SetValue(InputTransparentContainerElement.CascadeInputTransparentProperty, value); + } + + /// + /// Gets or sets the view whose layout is managed by this . + /// public View Content { get { return (View)GetValue(ContentProperty); } @@ -35,36 +51,24 @@ public View Content } object IContentView.Content => Content; + IView IContentView.PresentedContent => Content; - [Obsolete("Use InvalidateArrange if you need to trigger a new arrange and then put your arrange logic inside ArrangeOverride instead")] - protected override void LayoutChildren(double x, double y, double width, double height) + IReadOnlyList ILayoutController.Children => LogicalChildrenInternal; + + /// Bindable property for . + public new static readonly BindableProperty PaddingProperty = PaddingElement.PaddingProperty; + + /// + public new Thickness Padding { - for (var i = 0; i < LogicalChildrenInternal.Count; i++) - { - Element element = LogicalChildrenInternal[i]; - var child = element as View; - child?.Arrange(new Rect(x, y, width, height)); - } + get => (Thickness)GetValue(PaddingProperty); + set => SetValue(PaddingProperty, value); } - [Obsolete("Use MeasureOverride instead")] - protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint) - { - double widthRequest = WidthRequest; - double heightRequest = HeightRequest; - var childRequest = new SizeRequest(); - if ((widthRequest == -1 || heightRequest == -1) && Content != null) - { - childRequest = Content.Measure(widthConstraint, heightConstraint, MeasureFlags.IncludeMargins); - } + Thickness IPaddingElement.PaddingDefaultValueCreator() => default(Thickness); - return new SizeRequest - { - Request = new Size { Width = widthRequest != -1 ? widthRequest : childRequest.Request.Width, Height = heightRequest != -1 ? heightRequest : childRequest.Request.Height }, - Minimum = childRequest.Minimum - }; - } + void IPaddingElement.OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue) => InvalidateMeasure(); internal virtual void Clear() { @@ -78,9 +82,15 @@ protected override void ComputeConstraintForView(View view) var result = LayoutConstraint.None; if (isFixedVertically && view.VerticalOptions.Alignment == LayoutAlignment.Fill) + { result |= LayoutConstraint.VerticallyFixed; + } + if (isFixedHorizontally && view.HorizontalOptions.Alignment == LayoutAlignment.Fill) + { result |= LayoutConstraint.HorizontallyFixed; + } + view.ComputedConstraint = result; } @@ -95,15 +105,15 @@ static async void OnContentChanged(BindableObject bindable, object oldValue, obj var oldView = (View)oldValue; var newView = (View)newValue; - if (oldView != null) + if (oldView is not null) { - self.InternalChildren.Remove(oldView); + self.RemoveLogicalChild(oldView); oldView.ParentOverride = null; } - if (newView != null) + if (newView is not null) { - self.InternalChildren.Add(newView); + self.AddLogicalChild(newView); newView.ParentOverride = await TemplateUtilities.FindTemplatedParentAsync((Element)bindable); } } @@ -145,5 +155,101 @@ Size ICrossPlatformLayout.CrossPlatformArrange(Rect bounds) this.ArrangeContent(bounds); return bounds.Size; } + + Size IContentView.CrossPlatformMeasure(double widthConstraint, double heightConstraint) => ((ICrossPlatformLayout)this).CrossPlatformMeasure(widthConstraint, heightConstraint); + + Size IContentView.CrossPlatformArrange(Rect bounds) => + ((ICrossPlatformLayout)this).CrossPlatformArrange(bounds); + + + + [Obsolete("Use ArrangeOverride instead")] + protected override void LayoutChildren(double x, double y, double width, double height) + { + } + + [Obsolete("Use Measure with no flags.")] + public override SizeRequest Measure(double widthConstraint, double heightConstraint, MeasureFlags flags = MeasureFlags.None) + { + return base.Measure(widthConstraint, heightConstraint); + } + + + /// + /// Sends a child to the back of the visual stack. + /// + /// The view to lower in the visual stack. + /// Children are internally stored in visual stack order. + /// This means that raising or lowering a child also changes the order in which the children are enumerated. + [Obsolete("Use the ZIndex Property instead")] + public new void LowerChild(View view) + { + base.LowerChild(view); + } + + /// + /// Sends a child to the front of the visual stack. + /// + /// The view to raise in the visual stack. + /// Children are internally stored in visual stack order. + /// This means that raising or lowering a child also changes the order in which the children are enumerated. + [Obsolete("Use the ZIndex Property instead")] + public new void RaiseChild(View view) + { + base.RaiseChild(view); + } + + /// + /// Invalidates the current layout. + /// + /// Calling this method will invalidate the measure and triggers a new layout cycle. + [Obsolete("Use InvalidateMeasure depending on your scenario")] + protected override void InvalidateLayout() + { + base.InvalidateLayout(); + } + + /// + /// Invoked whenever a child of the layout has emitted . + /// Implement this method to add class handling for this event. + /// + [Obsolete("Subscribe to the MeasureInvalidated Event on the Children.")] + protected override void OnChildMeasureInvalidated() + { + } + + /// + /// If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later. + /// + /// The child for which to specify whether or not to track invalidation. + /// if should call , otherwise . + [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later.")] + protected override bool ShouldInvalidateOnChildAdded(View child) => true; + + /// + /// If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later. + /// + /// The child for which to specify whether or not to track invalidation. + /// if should call , otherwise . + [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later.")] + protected override bool ShouldInvalidateOnChildRemoved(View child) => true; + + /// + /// Use InvalidateMeasure depending on your scenario. This method will no longer work on .NET 10 and later. + /// + [Obsolete("Use InvalidateMeasure depending on your scenario. This method will no longer work on .NET 10 and later.")] + protected new void UpdateChildrenLayout() + { + } + + [Obsolete("Use MeasureOverride instead")] + protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint) + { + return base.OnMeasure(widthConstraint, heightConstraint); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Use IVisualTreeElement.GetVisualChildren() instead.", true)] + public new IReadOnlyList Children => base.Children; } } \ No newline at end of file diff --git a/src/Controls/src/Core/FlyoutPage/FlyoutPage.cs b/src/Controls/src/Core/FlyoutPage/FlyoutPage.cs index 366cb65df060..3896672fd087 100644 --- a/src/Controls/src/Core/FlyoutPage/FlyoutPage.cs +++ b/src/Controls/src/Core/FlyoutPage/FlyoutPage.cs @@ -146,7 +146,6 @@ Rect IFlyoutPageController.DetailBounds _detailBounds = value; if (_detail == null) throw new InvalidOperationException("Detail must be set before using a FlyoutPage"); - _detail.Layout(value); } } @@ -158,7 +157,6 @@ Rect IFlyoutPageController.FlyoutBounds _flyoutBounds = value; if (_flyout == null) throw new InvalidOperationException("Flyout must be set before using a FlyoutPage"); - _flyout.Layout(value); } } @@ -199,11 +197,6 @@ protected override void LayoutChildren(double x, double y, double width, double { if (Flyout == null || Detail == null) throw new InvalidOperationException("Flyout and Detail must be set before using a FlyoutPage"); - -#if !ANDROID - _flyout.Layout(_flyoutBounds); - _detail.Layout(_detailBounds); -#endif } protected override void OnAppearing() diff --git a/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs b/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs index f1b78e277aba..5919b26efe9f 100644 --- a/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs +++ b/src/Controls/src/Core/Handlers/Items/ItemsViewHandler.Windows.cs @@ -220,7 +220,7 @@ protected virtual void UpdateEmptyViewVisibility() emptyView.EmptyViewVisibility = WVisibility.Visible; if (PlatformView.ActualWidth >= 0 && PlatformView.ActualHeight >= 0) - _formsEmptyView?.Layout(new Rect(0, 0, PlatformView.ActualWidth, PlatformView.ActualHeight)); + _formsEmptyView?.Arrange(new Rect(0, 0, PlatformView.ActualWidth, PlatformView.ActualHeight)); } _emptyViewDisplayed = true; diff --git a/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs b/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs index 33de6c9be75d..9a4702c9748f 100644 --- a/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs +++ b/src/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cs @@ -822,8 +822,9 @@ void LayoutEmptyView() var frame = DetermineEmptyViewFrame(); - _emptyUIView.Frame = frame; + _emptyViewFormsElement?.Measure(frame.Width, frame.Height); _emptyViewFormsElement?.Arrange(frame.ToRectangle()); + _emptyUIView.Frame = frame; } TemplatedCell CreateAppropriateCellForLayout() diff --git a/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs b/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs index 2f83951b2dcf..5ffb1b7ed18d 100644 --- a/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs +++ b/src/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cs @@ -57,6 +57,11 @@ internal void SelectItem(object selectedItem) // Ensure the selected index is updated after the collection view's items generation is completed CollectionView.PerformBatchUpdates(null, _ => { + if (ItemsSource is EmptySource) + { + return; + } + CollectionView.SelectItem(index, true, UICollectionViewScrollPosition.None); }); } diff --git a/src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs b/src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs index 07ee8fa299d1..e9ef5cb01ee0 100644 --- a/src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs +++ b/src/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cs @@ -574,10 +574,13 @@ virtual internal CGRect LayoutEmptyView() var frame = DetermineEmptyViewFrame(); - _emptyUIView.Frame = frame; - if (_emptyViewFormsElement != null && ((IElementController)ItemsView).LogicalChildren.IndexOf(_emptyViewFormsElement) != -1) - _emptyViewFormsElement.Layout(frame.ToRectangle()); + { + _emptyViewFormsElement.Measure(frame.Width, frame.Height); + _emptyViewFormsElement.Arrange(frame.ToRectangle()); + } + + _emptyUIView.Frame = frame; return frame; } diff --git a/src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs b/src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs index a806cbaa2d54..cac489ed50cf 100644 --- a/src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs +++ b/src/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Foundation; +using Microsoft.Maui.Controls.Handlers.Items; using Microsoft.Maui.Controls.Platform; using ObjCRuntime; using UIKit; @@ -57,6 +58,11 @@ internal void SelectItem(object selectedItem) // Ensure the selected index is updated after the collection view's items generation is completed CollectionView.PerformBatchUpdates(null, _ => { + if (ItemsSource is EmptySource) + { + return; + } + CollectionView.SelectItem(index, true, UICollectionViewScrollPosition.None); }); } diff --git a/src/Controls/src/Core/IClippedToBoundsElement.cs b/src/Controls/src/Core/IClippedToBoundsElement.cs new file mode 100644 index 000000000000..0a1d4a321659 --- /dev/null +++ b/src/Controls/src/Core/IClippedToBoundsElement.cs @@ -0,0 +1,10 @@ +namespace Microsoft.Maui.Controls; + +interface IClippedToBoundsElement +{ + /// + /// Gets or sets a value which determines if the layout should clip its children to its bounds. + /// The default value is . + /// + bool IsClippedToBounds { get; set; } +} diff --git a/src/Controls/src/Core/IControlTemplated.cs b/src/Controls/src/Core/IControlTemplated.cs index d1c93f536082..642daa29f69a 100644 --- a/src/Controls/src/Core/IControlTemplated.cs +++ b/src/Controls/src/Core/IControlTemplated.cs @@ -7,7 +7,11 @@ internal interface IControlTemplated { ControlTemplate ControlTemplate { get; set; } - IList InternalChildren { get; } + IReadOnlyList InternalChildren { get; } + + void AddLogicalChild(Element element); + bool RemoveLogicalChild(Element element); + bool RemoveAt(int index); Element TemplateRoot { get; set; } diff --git a/src/Controls/src/Core/IInputTransparentContainerElement.cs b/src/Controls/src/Core/IInputTransparentContainerElement.cs index 19c9070a0630..5830cd311847 100644 --- a/src/Controls/src/Core/IInputTransparentContainerElement.cs +++ b/src/Controls/src/Core/IInputTransparentContainerElement.cs @@ -7,6 +7,15 @@ interface IInputTransparentContainerElement { bool InputTransparent { get; } + /// + /// Gets or sets a value that controls whether child elements + /// inherit the input transparency of this layout when the tranparency is . + /// + /// + /// to cause child elements to inherit the input transparency of this layout, + /// when this layout's property is . + /// to cause child elements to ignore the input tranparency of this layout. + /// bool CascadeInputTransparent { get; } Element Parent { get; } diff --git a/src/Controls/src/Core/IPaddingElement.cs b/src/Controls/src/Core/IPaddingElement.cs index 1b93d3b1ccb0..6de3fe733304 100644 --- a/src/Controls/src/Core/IPaddingElement.cs +++ b/src/Controls/src/Core/IPaddingElement.cs @@ -1,16 +1,20 @@ #nullable disable using System.ComponentModel; -namespace Microsoft.Maui.Controls +namespace Microsoft.Maui.Controls; + +[EditorBrowsable(EditorBrowsableState.Never)] +public interface IPaddingElement { - [EditorBrowsable(EditorBrowsableState.Never)] - public interface IPaddingElement - { - //note to implementor: implement this property publicly - Thickness Padding { get; } + /// + /// Gets or sets the inner padding of the layout. + /// The default value is a with all values set to 0. + /// + /// The padding is the space between the bounds of a layout and the bounding region into which its children should be arranged into. + //note to implementor: implement this property publicly + Thickness Padding { get; } - //note to implementor: but implement this method explicitly - void OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue); - Thickness PaddingDefaultValueCreator(); - } + //note to implementor: but implement this method explicitly + void OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue); + Thickness PaddingDefaultValueCreator(); } \ No newline at end of file diff --git a/src/Controls/src/Core/InputTransparentContainerElement.cs b/src/Controls/src/Core/InputTransparentContainerElement.cs new file mode 100644 index 000000000000..c2b102d9c1ec --- /dev/null +++ b/src/Controls/src/Core/InputTransparentContainerElement.cs @@ -0,0 +1,21 @@ +namespace Microsoft.Maui.Controls; + +static class InputTransparentContainerElement +{ + /// Bindable property for . + public static readonly BindableProperty CascadeInputTransparentProperty = + BindableProperty.Create("CascadeInputTransparent", typeof(bool), typeof(IInputTransparentContainerElement), true, + propertyChanged: OnCascadeInputTransparentPropertyChanged); + + static void OnCascadeInputTransparentPropertyChanged(BindableObject bindable, object oldValue, object newValue) + { + // We only need to update if the cascade changes anything, namely when InputTransparent=true. + // When InputTransparent=false, then the cascade property has no effect. + if (bindable is IInputTransparentContainerElement layout && + layout.InputTransparent && + layout is IPropertyPropagationController ppc) + { + ppc.PropagatePropertyChanged(VisualElement.InputTransparentProperty.PropertyName); + } + } +} \ No newline at end of file diff --git a/src/Controls/src/Core/Layout/Layout.cs b/src/Controls/src/Core/Layout/Layout.cs index 9f29c845569d..9f8b9276509b 100644 --- a/src/Controls/src/Core/Layout/Layout.cs +++ b/src/Controls/src/Core/Layout/Layout.cs @@ -357,9 +357,7 @@ public Graphics.Size CrossPlatformArrange(Graphics.Rect bounds) } /// Bindable property for . - public static readonly BindableProperty CascadeInputTransparentProperty = - BindableProperty.Create(nameof(CascadeInputTransparent), typeof(bool), typeof(Layout), true, - propertyChanged: OnCascadeInputTransparentPropertyChanged); + public static readonly BindableProperty CascadeInputTransparentProperty = InputTransparentContainerElement.CascadeInputTransparentProperty; /// /// Gets or sets a value that controls whether child elements @@ -372,18 +370,8 @@ public Graphics.Size CrossPlatformArrange(Graphics.Rect bounds) /// public bool CascadeInputTransparent { - get => (bool)GetValue(CascadeInputTransparentProperty); - set => SetValue(CascadeInputTransparentProperty, value); - } - - static void OnCascadeInputTransparentPropertyChanged(BindableObject bindable, object oldValue, object newValue) - { - // We only need to update if the cascade changes anything, namely when InputTransparent=true. - // When InputTransparent=false, then the cascade property has no effect. - if (bindable is Layout layout && layout.InputTransparent) - { - layout.RefreshInputTransparentProperty(); - } + get => (bool)GetValue(InputTransparentContainerElement.CascadeInputTransparentProperty); + set => SetValue(InputTransparentContainerElement.CascadeInputTransparentProperty, value); } private protected override string GetDebuggerDisplay() diff --git a/src/Controls/src/Core/LegacyLayouts/Layout.cs b/src/Controls/src/Core/LegacyLayouts/Layout.cs index e02c311f545b..467278a6bdfe 100644 --- a/src/Controls/src/Core/LegacyLayouts/Layout.cs +++ b/src/Controls/src/Core/LegacyLayouts/Layout.cs @@ -90,17 +90,14 @@ Size ILayoutManager.ArrangeChildren(Rect bounds) /// Base class for layouts that allow you to arrange and group UI controls in your application. /// [Obsolete("Use Microsoft.Maui.Controls.Layout instead. For more information, see https://learn.microsoft.com/dotnet/maui/user-interface/layouts/custom")] - public abstract class Layout : View, ILayout, ILayoutController, IPaddingElement, IView, IVisualTreeElement, IInputTransparentContainerElement + public abstract class Layout : View, ILayout, ILayoutController, IPaddingElement, IView, IVisualTreeElement, IInputTransparentContainerElement, ICrossPlatformLayout, IClippedToBoundsElement { + /// Bindable property for . - public static readonly BindableProperty IsClippedToBoundsProperty = - BindableProperty.Create(nameof(IsClippedToBounds), typeof(bool), typeof(Layout), false, - propertyChanged: IsClippedToBoundsPropertyChanged); + public static readonly BindableProperty IsClippedToBoundsProperty = ClippedToBoundsElement.IsClippedToBoundsProperty; /// Bindable property for . - public static readonly BindableProperty CascadeInputTransparentProperty = - BindableProperty.Create(nameof(CascadeInputTransparent), typeof(bool), typeof(Layout), true, - propertyChanged: OnCascadeInputTransparentPropertyChanged); + public static readonly BindableProperty CascadeInputTransparentProperty = InputTransparentContainerElement.CascadeInputTransparentProperty; /// Bindable property for . public static readonly BindableProperty PaddingProperty = PaddingElement.PaddingProperty; @@ -108,16 +105,23 @@ public abstract class Layout : View, ILayout, ILayoutController, IPaddingElement bool _hasDoneLayout; Size _lastLayoutSize = new Size(-1, -1); + private protected bool UseCompatibilityMode {get; } + protected Layout() { - //if things were added in base ctor (through implicit styles), the items added aren't properly parented - if (InternalChildren.Count > 0) + UseCompatibilityMode = !(this is ScrollView || this is TemplatedView || this is ContentPresenter); + + if (UseCompatibilityMode) { - InternalChildrenOnCollectionChanged(this, - new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, InternalChildren)); - } + //if things were added in base ctor (through implicit styles), the items added aren't properly parented + if (InternalChildren.Count > 0) + { + InternalChildrenOnCollectionChanged(this, + new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, InternalChildren)); + } - InternalChildren.CollectionChanged += InternalChildrenOnCollectionChanged; + InternalChildren.CollectionChanged += InternalChildrenOnCollectionChanged; + } } /// @@ -152,24 +156,16 @@ public Thickness Padding /// public bool CascadeInputTransparent { - get => (bool)GetValue(CascadeInputTransparentProperty); - set => SetValue(CascadeInputTransparentProperty, value); + get => (bool)GetValue(InputTransparentContainerElement.CascadeInputTransparentProperty); + set => SetValue(InputTransparentContainerElement.CascadeInputTransparentProperty, value); } Thickness IPaddingElement.PaddingDefaultValueCreator() => default(Thickness); void IPaddingElement.OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue) => InvalidateLayout(); - static void IsClippedToBoundsPropertyChanged(BindableObject bindableObject, object oldValue, object newValue) - { - if (bindableObject is IView view) - { - view.Handler?.UpdateValue(nameof(Maui.ILayout.ClipsToBounds)); - } - } - private protected override IList LogicalChildrenInternalBackingStore - => InternalChildren; + => UseCompatibilityMode ? InternalChildren : base.LogicalChildrenInternalBackingStore; internal ObservableCollection InternalChildren { get; } = new ObservableCollection(); @@ -189,28 +185,33 @@ private protected override IList LogicalChildrenInternalBackingStore /// /// Calling this method frequently can have negative impacts on performance. [Obsolete("Call InvalidateMeasure instead depending on your scenario.")] - public void ForceLayout() => SizeAllocated(Width, Height); + public void ForceLayout() + { + if (UseCompatibilityMode) + SizeAllocated(Width, Height); + else + InvalidateMeasure(); + } - IReadOnlyList IVisualTreeElement.GetVisualChildren() => Children.ToList().AsReadOnly(); + IReadOnlyList IVisualTreeElement.GetVisualChildren() + => UseCompatibilityMode ? InternalChildren.ToList().AsReadOnly() : base.LogicalChildrenInternal; -#pragma warning disable CS0672 // Member overrides obsolete member -#pragma warning disable CS0618 // Type or member is obsolete + [Obsolete("Use Measure with no flags.")] public override SizeRequest Measure(double widthConstraint, double heightConstraint, MeasureFlags flags = MeasureFlags.None) -#pragma warning restore CS0618 // Type or member is obsolete { -#pragma warning disable CS0618 // Type or member is obsolete + if (!UseCompatibilityMode) + { + return MeasureOverride(widthConstraint, heightConstraint); + } + SizeRequest size = base.Measure(widthConstraint - Padding.HorizontalThickness, heightConstraint - Padding.VerticalThickness, flags); -#pragma warning restore CS0618 // Type or member is obsolete -#pragma warning disable CS0618 // Type or member is obsolete var request = new Size(size.Request.Width + Padding.HorizontalThickness, size.Request.Height + Padding.VerticalThickness); var minimum = new Size(size.Minimum.Width + Padding.HorizontalThickness, size.Minimum.Height + Padding.VerticalThickness); DesiredSize = request; return new SizeRequest(request, minimum); -#pragma warning restore CS0618 // Type or member is obsolete } -#pragma warning restore CS0672 // Member overrides obsolete member /// /// Positions a child element into a bounding region while respecting the child elements and . @@ -222,22 +223,27 @@ public override SizeRequest Measure(double widthConstraint, double heightConstra [Obsolete("Use the Arrange method on child instead.")] public static void LayoutChildIntoBoundingRegion(VisualElement child, Rect region) { - bool isRightToLeft = false; - if (child.Parent is IFlowDirectionController parent && - (isRightToLeft = parent.ApplyEffectiveFlowDirectionToChildContainer && - parent.EffectiveFlowDirection.IsRightToLeft()) && - (parent.Width - region.Right) != region.X) + if(child?.Parent is Layout layout && !layout.UseCompatibilityMode) { - region = new Rect(parent.Width - region.Right, region.Y, region.Width, region.Height); + return; } - if (child is IView fe && fe.Handler != null) + if (child is IView fe && fe.Handler is not null) { // The new arrange methods will take care of all the alignment and margins and such fe.Arrange(region); return; } + bool isRightToLeft = false; + if (child.Parent is IFlowDirectionController parent && + (isRightToLeft = parent.ApplyEffectiveFlowDirectionToChildContainer && + parent.EffectiveFlowDirection.IsRightToLeft()) && + (parent.Width - region.Right) != region.X) + { + region = new Rect(parent.Width - region.Right, region.Y, region.Width, region.Height); + } + if (!(child is View view)) { child.Layout(region); @@ -287,9 +293,12 @@ public static void LayoutChildIntoBoundingRegion(VisualElement child, Rect regio /// The view to lower in the visual stack. /// Children are internally stored in visual stack order. /// This means that raising or lowering a child also changes the order in which the children are enumerated. - [Obsolete("Use the ZIndex Property instead")] + [Obsolete("Use the ZIndex Property instead. This property no longer works on .NET 10 and later.")] public void LowerChild(View view) { + if (!UseCompatibilityMode) + return; + if (!InternalChildren.Contains(view) || InternalChildren.First() == view) { return; @@ -305,9 +314,12 @@ public void LowerChild(View view) /// The view to raise in the visual stack. /// Children are internally stored in visual stack order. /// This means that raising or lowering a child also changes the order in which the children are enumerated. - [Obsolete("Use the ZIndex Property instead")] + [Obsolete("Use the ZIndex Property instead. This property no longer works on .NET 10 and later.")] public void RaiseChild(View view) { + if (!UseCompatibilityMode) + return; + if (!InternalChildren.Contains(view) || InternalChildren.Last() == view) { return; @@ -324,6 +336,12 @@ public void RaiseChild(View view) [Obsolete("Use InvalidateMeasure depending on your scenario")] protected virtual void InvalidateLayout() { + if (!UseCompatibilityMode) + { + this.InvalidateMeasure(); + return; + } + SetNeedsLayout(); InvalidateMeasureInternal(InvalidationTrigger.MeasureChanged); if (!_hasDoneLayout) @@ -352,6 +370,12 @@ void SetNeedsLayout() internal override void OnChildMeasureInvalidated(VisualElement child, InvalidationTrigger trigger) { + if (!UseCompatibilityMode) + { + base.OnChildMeasureInvalidated(child, trigger); + return; + } + SetNeedsLayout(); InvalidateMeasureCache(); @@ -373,6 +397,11 @@ internal override void OnChildMeasureInvalidated(VisualElement child, Invalidati /// This method has a default implementation and application developers must call the base implementation. protected void OnChildMeasureInvalidated(object sender, EventArgs e) { + if (!UseCompatibilityMode) + { + return; + } + OnChildMeasureInvalidated(); } @@ -393,6 +422,11 @@ Size IView.Measure(double widthConstraint, double heightConstraint) protected override Size MeasureOverride(double widthConstraint, double heightConstraint) { + if (!UseCompatibilityMode) + { + return base.MeasureOverride(widthConstraint, heightConstraint); + } + #pragma warning disable CS0618 // Type or member is obsolete var sansMargins = OnMeasure(widthConstraint, heightConstraint).Request; #pragma warning restore CS0618 // Type or member is obsolete @@ -402,6 +436,12 @@ protected override Size MeasureOverride(double widthConstraint, double heightCon protected override void OnSizeAllocated(double width, double height) { base.OnSizeAllocated(width, height); + + if (!UseCompatibilityMode) + { + return; + } + UpdateChildrenLayout(); } @@ -411,7 +451,7 @@ protected override void OnSizeAllocated(double width, double height) /// /// The child for which to specify whether or not to track invalidation. /// if should call , otherwise . - [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride")] + [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later.")] protected virtual bool ShouldInvalidateOnChildAdded(View child) => true; /// @@ -420,16 +460,21 @@ protected override void OnSizeAllocated(double width, double height) /// /// The child for which to specify whether or not to track invalidation. /// if should call , otherwise . - [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride")] + [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later.")] protected virtual bool ShouldInvalidateOnChildRemoved(View child) => true; /// /// Instructs the layout to relayout all of its children. /// /// This method starts a new layout cycle for the layout. Invoking this method frequently can negatively impact performance. - [Obsolete("Use InvalidateMeasure depending on your scenario")] + [Obsolete("Use InvalidateMeasure depending on your scenario. This method will no longer work on .NET 10 and later.")] protected void UpdateChildrenLayout() { + if (!UseCompatibilityMode) + { + return; + } + _hasDoneLayout = true; if (!ShouldLayoutChildren()) @@ -491,6 +536,11 @@ protected void UpdateChildrenLayout() internal static void LayoutChildIntoBoundingRegion(View child, Rect region, SizeRequest childSizeRequest) #pragma warning restore CS0618 // Type or member is obsolete { + if(child?.Parent is Layout layout && !layout.UseCompatibilityMode) + { + return; + } + bool isRightToLeft = false; if (child.Parent is IFlowDirectionController parent && (isRightToLeft = parent.ApplyEffectiveFlowDirectionToChildContainer && parent.EffectiveFlowDirection.IsRightToLeft())) { @@ -549,6 +599,12 @@ internal static void LayoutChildIntoBoundingRegion(View child, Rect region, Size internal override void OnIsVisibleChanged(bool oldValue, bool newValue) { base.OnIsVisibleChanged(oldValue, newValue); + + if(!UseCompatibilityMode) + { + return; + } + if (newValue) { if (_lastLayoutSize != new Size(Width, Height)) @@ -558,19 +614,13 @@ internal override void OnIsVisibleChanged(bool oldValue, bool newValue) } } - static int GetElementDepth(Element view) + void InternalChildrenOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { - var result = 0; - while (view.Parent != null) + if(!UseCompatibilityMode) { - result++; - view = view.Parent; + return; } - return result; - } - void InternalChildrenOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { if (e.Action == NotifyCollectionChangedAction.Move) { return; @@ -611,9 +661,29 @@ void InternalChildrenOnCollectionChanged(object sender, NotifyCollectionChangedE } } } + protected override void OnChildAdded(Element child) + { + base.OnChildAdded(child); + + if (!UseCompatibilityMode) + InternalChildren.Add(child); + } + + protected override void OnChildRemoved(Element child, int oldLogicalIndex) + { + base.OnChildRemoved(child, oldLogicalIndex); + + if (!UseCompatibilityMode) + InternalChildren.Remove(child); + } void OnInternalAdded(View view) { + if(!UseCompatibilityMode) + { + return; + } + var parent = view.Parent as Layout; parent?.InternalChildren.Remove(view); @@ -626,6 +696,11 @@ void OnInternalAdded(View view) void OnInternalRemoved(View view, int oldIndex) { + if(!UseCompatibilityMode) + { + return; + } + OnChildRemoved(view, oldIndex); if (ShouldInvalidateOnChildRemoved(view)) { @@ -635,6 +710,11 @@ void OnInternalRemoved(View view, int oldIndex) bool ShouldLayoutChildren() { + if(!UseCompatibilityMode) + { + return false; + } + if (Width <= 0 || Height <= 0 || !LogicalChildrenInternal.Any() || !IsVisible || !IsPlatformStateConsistent || DisableLayout) { return false; @@ -679,30 +759,33 @@ protected override Size ArrangeOverride(Rect bounds) return Frame.Size; } - /// - public Size CrossPlatformMeasure(double widthConstraint, double heightConstraint) + + Size ICrossPlatformLayout.CrossPlatformMeasure(double widthConstraint, double heightConstraint) { #pragma warning disable CS0618 // Type or member is obsolete return OnMeasure(widthConstraint, heightConstraint).Request; #pragma warning restore CS0618 // Type or member is obsolete } - /// - public Size CrossPlatformArrange(Rect bounds) + Size ICrossPlatformLayout.CrossPlatformArrange(Rect bounds) { UpdateChildrenLayout(); return Frame.Size; } - static void OnCascadeInputTransparentPropertyChanged(BindableObject bindable, object oldValue, object newValue) + /// + [Obsolete("Use MeasureOverride.")] + public Size CrossPlatformMeasure(double widthConstraint, double heightConstraint) + { + return ((ICrossPlatformLayout)this).CrossPlatformMeasure(widthConstraint, heightConstraint); + } + + /// + [Obsolete("Use ArrangeOverride.")] + public Size CrossPlatformArrange(Rect bounds) { - // We only need to update if the cascade changes anything, namely when InputTransparent=true. - // When InputTransparent=false, then the cascade property has no effect. - if (bindable is Layout layout && layout.InputTransparent) - { - layout.RefreshInputTransparentProperty(); - } + return ((ICrossPlatformLayout)this).CrossPlatformArrange(bounds); } } } diff --git a/src/Controls/src/Core/Page/Page.cs b/src/Controls/src/Core/Page/Page.cs index 3f690538fdce..b738cfffd636 100644 --- a/src/Controls/src/Core/Page/Page.cs +++ b/src/Controls/src/Core/Page/Page.cs @@ -69,10 +69,6 @@ public partial class Page : VisualElement, ILayout, IPageController, IElementCon readonly Lazy> _platformConfigurationRegistry; - Rect _containerArea; - - bool _containerAreaSet; - bool _hasAppeared; private protected bool HasAppeared => _hasAppeared; @@ -178,16 +174,13 @@ public string Title /// /// For internal use only. This API can be changed or removed without notice at any time. [EditorBrowsable(EditorBrowsableState.Never)] + + [Obsolete("This property is obsolete and will be removed in a future version. Use Bounds instead.")] public Rect ContainerArea { - get { return _containerArea; } + get { return Bounds; } set { - if (_containerArea == value) - return; - _containerAreaSet = true; - _containerArea = value; - ForceLayout(); } } @@ -207,6 +200,7 @@ public bool IgnoresContainerArea /// /// For internal use only. This API can be changed or removed without notice at any time. [EditorBrowsable(EditorBrowsableState.Never)] + // TODO: Mark this obsolete and fix everywhere that references this property to use the more correct add/remove logical children public ObservableCollection InternalChildren { get; } = new ObservableCollection(); /// @@ -264,7 +258,10 @@ Thickness ISafeAreaView2.SafeAreaInsets /// /// Raised when the children of this page, and thus potentially the layout, have changed. /// + [Obsolete("Use SizeChanged.")] +#pragma warning disable CS0067 // Type or member is obsolete public event EventHandler LayoutChanged; +#pragma warning disable CS0067 // Type or member is obsolete /// /// Raised when this page is visually appearing on screen. @@ -438,34 +435,6 @@ public bool SendBackButtonPressed() [Obsolete("Use ArrangeOverride instead")] protected virtual void LayoutChildren(double x, double y, double width, double height) { - var area = new Rect(x, y, width, height); - Rect originalArea = area; - if (_containerAreaSet) - { - area = ContainerArea; - area.X += Padding.Left; - area.Y += Padding.Right; - area.Width -= Padding.HorizontalThickness; - area.Height -= Padding.VerticalThickness; - area.Width = Math.Max(0, area.Width); - area.Height = Math.Max(0, area.Height); - } - - IList elements = this.InternalChildren; - foreach (Element element in elements) - { - var child = element as VisualElement; - if (child == null) - continue; - - var page = child as Page; -#pragma warning disable CS0618 // Type or member is obsolete - if (page != null && page.IgnoresContainerArea) - Maui.Controls.Compatibility.Layout.LayoutChildIntoBoundingRegion(child, originalArea); - else - Maui.Controls.Compatibility.Layout.LayoutChildIntoBoundingRegion(child, area); -#pragma warning restore CS0618 // Type or member is obsolete - } } /// @@ -584,36 +553,7 @@ protected override void OnSizeAllocated(double width, double height) [Obsolete("Use ArrangeOverride instead")] protected void UpdateChildrenLayout() { - if (!ShouldLayoutChildren()) - return; - - var logicalChildren = this.InternalChildren; - var startingLayout = new List(logicalChildren.Count); - foreach (Element el in logicalChildren) - { - if (el is VisualElement c) - startingLayout.Add(c.Bounds); - } - - double x = Padding.Left; - double y = Padding.Top; - double w = Math.Max(0, Width - Padding.HorizontalThickness); - double h = Math.Max(0, Height - Padding.VerticalThickness); - - LayoutChildren(x, y, w, h); - - for (var i = 0; i < logicalChildren.Count; i++) - { - var element = logicalChildren[i]; - if (element is VisualElement c) - { - if (startingLayout.Count <= i || c.Bounds != startingLayout[i]) - { - LayoutChanged?.Invoke(this, EventArgs.Empty); - return; - } - } - } + } internal void OnAppearing(Action action) @@ -729,11 +669,6 @@ void InternalChildrenOnCollectionChanged(object sender, NotifyCollectionChangedE InsertLogicalChild(insertIndex, item); - if (item is VisualElement) - { - InvalidateMeasureInternal(InvalidationTrigger.MeasureChanged); - } - if (index >= 0) { index++; @@ -764,33 +699,6 @@ void OnToolbarItemsCollectionChanged(object sender, NotifyCollectionChangedEvent } } - bool ShouldLayoutChildren() - { - var logicalChildren = this.InternalChildren; - if (logicalChildren.Count == 0 || Width <= 0 || Height <= 0 || !IsPlatformStateConsistent) - return false; - - var container = this as IPageContainer; - if (container?.CurrentPage != null) - { - if (InternalChildren.Contains(container.CurrentPage)) - return container.CurrentPage.IsPlatformEnabled && container.CurrentPage.IsPlatformStateConsistent; - return true; - } - - var any = false; - for (var i = 0; i < logicalChildren.Count; i++) - { - var v = logicalChildren[i] as VisualElement; - if (v != null && (!v.IsPlatformEnabled || !v.IsPlatformStateConsistent)) - { - any = true; - break; - } - } - return !any; - } - /// public IPlatformElementConfiguration On() where T : IConfigPlatform { diff --git a/src/Controls/src/Core/Platform/Windows/CollectionView/FormsGridView.cs b/src/Controls/src/Core/Platform/Windows/CollectionView/FormsGridView.cs index ac376dbf46cd..e7dbe69f5eb1 100644 --- a/src/Controls/src/Core/Platform/Windows/CollectionView/FormsGridView.cs +++ b/src/Controls/src/Core/Platform/Windows/CollectionView/FormsGridView.cs @@ -157,7 +157,7 @@ protected override void OnApplyTemplate() protected override global::Windows.Foundation.Size ArrangeOverride(global::Windows.Foundation.Size finalSize) { - _formsEmptyView?.Layout(new Rect(0, 0, finalSize.Width, finalSize.Height)); + _formsEmptyView?.Arrange(new Rect(0, 0, finalSize.Width, finalSize.Height)); return base.ArrangeOverride(finalSize); } diff --git a/src/Controls/src/Core/Platform/Windows/FormsListView.cs b/src/Controls/src/Core/Platform/Windows/FormsListView.cs index 8183b6fd5272..98ac1c68a446 100644 --- a/src/Controls/src/Core/Platform/Windows/FormsListView.cs +++ b/src/Controls/src/Core/Platform/Windows/FormsListView.cs @@ -82,7 +82,7 @@ protected override void OnApplyTemplate() { if (_formsEmptyView != null) { - _formsEmptyView.Layout(new Rect(0, 0, finalSize.Width, finalSize.Height)); + _formsEmptyView.Arrange(new Rect(0, 0, finalSize.Width, finalSize.Height)); } return base.ArrangeOverride(finalSize); diff --git a/src/Controls/src/Core/Platform/Windows/MauiPresenter.cs b/src/Controls/src/Core/Platform/Windows/MauiPresenter.cs deleted file mode 100644 index 76582e399d6b..000000000000 --- a/src/Controls/src/Core/Platform/Windows/MauiPresenter.cs +++ /dev/null @@ -1,31 +0,0 @@ -#nullable disable -using System; -using Microsoft.Maui.Controls; -using Microsoft.Maui.Graphics; -using Microsoft.UI.Xaml; - -namespace Microsoft.Maui.Controls.Platform -{ - internal partial class MauiPresenter : Microsoft.UI.Xaml.Controls.ContentPresenter - { - public MauiPresenter() - { - Loaded += FormsPresenter_Loaded; - Unloaded += FormsPresenter_Unloaded; - SizeChanged += (s, e) => - { - if (ActualWidth > 0 && ActualHeight > 0 && DataContext != null) - { - var page = (Page)DataContext; - ((Page)page.RealParent).ContainerArea = new Rect(0, 0, ActualWidth, ActualHeight); - } - }; - } - - void FormsPresenter_Loaded(object sender, RoutedEventArgs e) - => (DataContext as Page)?.SendAppearing(); - - void FormsPresenter_Unloaded(object sender, RoutedEventArgs e) - => (DataContext as Page)?.SendDisappearing(); - } -} diff --git a/src/Controls/src/Core/Platform/Windows/Styles/MauiControlsPageControlStyle.xaml b/src/Controls/src/Core/Platform/Windows/Styles/MauiControlsPageControlStyle.xaml index eb296b37cda9..bfa330fc74ce 100644 --- a/src/Controls/src/Core/Platform/Windows/Styles/MauiControlsPageControlStyle.xaml +++ b/src/Controls/src/Core/Platform/Windows/Styles/MauiControlsPageControlStyle.xaml @@ -43,7 +43,7 @@ - + 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 e8161c75850e..fb336f45b5a9 100644 --- a/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txt @@ -1,12 +1,14 @@ -#nullable enable -const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! +#nullable enable Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.GradientBrushParser(Microsoft.Maui.Graphics.Converters.ColorTypeConverter? colorConverter = null) -> void Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.Parse(string? css) -> Microsoft.Maui.Controls.GradientBrush? +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ContentPresenter.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ContentPresenter.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ContentPresenter.Padding.set -> void +~Microsoft.Maui.Controls.ContentPresenter.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime oldDate, System.DateTime newDate) -> void Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime? oldDate, System.DateTime? newDate) -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.NewDate.get -> System.DateTime @@ -36,7 +38,6 @@ Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Subscribe(object subscriber, string message, System.Action callback, TSender source = null) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void -Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.ITextAlignmentElement Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void @@ -50,6 +51,7 @@ Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextT Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void ~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string +Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.Fixed = Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed | Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed -> Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed = 1 -> Microsoft.Maui.Controls.LayoutConstraint @@ -59,16 +61,24 @@ Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed = 2 -> Microsoft.Maui.C *REMOVED*Microsoft.Maui.Controls.MessagingCenter.MessagingCenter() -> void ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, Microsoft.Maui.FlowDirection flowDirection, params string[] buttons) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, params string[] buttons) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.Popover = 5 -> Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Request.get -> Android.Webkit.IWebResourceRequest! Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Response.get -> Android.Webkit.WebResourceResponse? Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Response.set -> void Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Sender.get -> Android.Webkit.WebView! +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ScrollView.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ScrollView.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ScrollView.Padding.set -> void +~Microsoft.Maui.Controls.ScrollView.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.UpdateChildrenLayout() -> void Microsoft.Maui.Controls.SearchBar.ReturnType.get -> Microsoft.Maui.ReturnType Microsoft.Maui.Controls.SearchBar.ReturnType.set -> void ~Microsoft.Maui.Controls.SearchBar.SearchIconColor.get -> Microsoft.Maui.Graphics.Color @@ -77,6 +87,16 @@ Microsoft.Maui.Controls.ShadowTypeConverter Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void ~Microsoft.Maui.Controls.Switch.OffColor.get -> Microsoft.Maui.Graphics.Color ~Microsoft.Maui.Controls.Switch.OffColor.set -> void +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.set -> void +Microsoft.Maui.Controls.TemplatedView.Children.get -> System.Collections.Generic.IReadOnlyList! +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.get -> bool +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.set -> void +Microsoft.Maui.Controls.TemplatedView.LowerChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.TemplatedView.Padding.set -> void +Microsoft.Maui.Controls.TemplatedView.RaiseChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan? *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.OldTime.get -> System.TimeSpan @@ -92,11 +112,11 @@ Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Headers.get -> Syst Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Method.get -> string! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs? Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.QueryParameters.get -> System.Collections.Generic.IReadOnlyDictionary! -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.IO.Stream? content) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.Threading.Tasks.Task! contentTask) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Uri.get -> System.Uri! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs! platformArgs) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(System.Uri! uri, string! method) -> void @@ -106,6 +126,12 @@ Microsoft.Maui.Controls.Xaml.Internals.AllowImplicitXmlnsDeclarationAttribute.Al ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.Target.get -> string *REMOVED*~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace) -> void ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string target) -> void +const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -120,9 +146,16 @@ override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.Convert override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.Compatibility.AbsoluteLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.Compatibility.Grid.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildAdded(Microsoft.Maui.Controls.Element child) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildRemoved(Microsoft.Maui.Controls.Element child, int oldLogicalIndex) -> void ~override Microsoft.Maui.Controls.Compatibility.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.ContentPresenter.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ContentPresenter.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ContentPresenter.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ContentPresenter.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -169,7 +202,12 @@ override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.CanConvert override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.ScrollView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ScrollView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ScrollView.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ScrollView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type? sourceType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object! @@ -189,7 +227,11 @@ override Microsoft.Maui.Controls.Shapes.PathGeometryConverter.ConvertTo(System.C ~override Microsoft.Maui.Controls.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedPage.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.TemplatedView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.TemplatedView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View! child) -> bool +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View! child) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -247,15 +289,22 @@ static Microsoft.Maui.Controls.ViewExtensions.ScaleXToAsync(this Microsoft.Maui. static Microsoft.Maui.Controls.ViewExtensions.ScaleYToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.TranslateToAsync(this Microsoft.Maui.Controls.VisualElement! view, double x, double y, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! ~static Microsoft.Maui.Controls.WebView.MapJavaScriptEnabled(Microsoft.Maui.Handlers.IWebViewHandler handler, Microsoft.Maui.Controls.WebView webView) -> void +~static readonly Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ContentPresenter.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.Button.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.ImageButton.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.WebView.JavaScriptEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverRectProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverSourceViewProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.ReturnTypeProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.SearchIconColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Shell.NavBarVisibilityAnimationEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Switch.OffColorProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.IsClippedToBoundsProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, TPropertyType oldValue, TPropertyType newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangingDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void 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 6701f5cb535b..26d2a5d5a1ed 100644 --- a/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txt @@ -1,12 +1,14 @@ -#nullable enable -const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! +#nullable enable Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.GradientBrushParser(Microsoft.Maui.Graphics.Converters.ColorTypeConverter? colorConverter = null) -> void Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.Parse(string? css) -> Microsoft.Maui.Controls.GradientBrush? +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ContentPresenter.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ContentPresenter.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ContentPresenter.Padding.set -> void +~Microsoft.Maui.Controls.ContentPresenter.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime oldDate, System.DateTime newDate) -> void Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime? oldDate, System.DateTime? newDate) -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.NewDate.get -> System.DateTime @@ -38,7 +40,6 @@ Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Subscribe(object subscriber, string message, System.Action callback, TSender source = null) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void -Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.ITextAlignmentElement Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void @@ -52,6 +53,7 @@ Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextT Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void ~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string +Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.Fixed = Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed | Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed -> Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed = 1 -> Microsoft.Maui.Controls.LayoutConstraint @@ -61,15 +63,23 @@ Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed = 2 -> Microsoft.Maui.C *REMOVED*Microsoft.Maui.Controls.MessagingCenter.MessagingCenter() -> void ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, Microsoft.Maui.FlowDirection flowDirection, params string[] buttons) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, params string[] buttons) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.Popover = 5 -> Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Request.get -> Foundation.NSUrlRequest! Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Sender.get -> WebKit.WKWebView! Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.UrlSchemeTask.get -> WebKit.IWKUrlSchemeTask! +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ScrollView.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ScrollView.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ScrollView.Padding.set -> void +~Microsoft.Maui.Controls.ScrollView.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.UpdateChildrenLayout() -> void Microsoft.Maui.Controls.SearchBar.ReturnType.get -> Microsoft.Maui.ReturnType Microsoft.Maui.Controls.SearchBar.ReturnType.set -> void ~Microsoft.Maui.Controls.SearchBar.SearchIconColor.get -> Microsoft.Maui.Graphics.Color @@ -78,6 +88,16 @@ Microsoft.Maui.Controls.ShadowTypeConverter Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void ~Microsoft.Maui.Controls.Switch.OffColor.get -> Microsoft.Maui.Graphics.Color ~Microsoft.Maui.Controls.Switch.OffColor.set -> void +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.set -> void +Microsoft.Maui.Controls.TemplatedView.Children.get -> System.Collections.Generic.IReadOnlyList! +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.get -> bool +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.set -> void +Microsoft.Maui.Controls.TemplatedView.LowerChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.TemplatedView.Padding.set -> void +Microsoft.Maui.Controls.TemplatedView.RaiseChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan? *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.OldTime.get -> System.TimeSpan @@ -93,11 +113,11 @@ Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Headers.get -> Syst Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Method.get -> string! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs? Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.QueryParameters.get -> System.Collections.Generic.IReadOnlyDictionary! -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.IO.Stream? content) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.Threading.Tasks.Task! contentTask) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Uri.get -> System.Uri! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs! platformArgs) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(System.Uri! uri, string! method) -> void @@ -107,6 +127,12 @@ Microsoft.Maui.Controls.Xaml.Internals.AllowImplicitXmlnsDeclarationAttribute.Al ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.Target.get -> string *REMOVED*~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace) -> void ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string target) -> void +const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -121,9 +147,16 @@ override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.Convert override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.Compatibility.AbsoluteLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.Compatibility.Grid.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildAdded(Microsoft.Maui.Controls.Element child) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildRemoved(Microsoft.Maui.Controls.Element child, int oldLogicalIndex) -> void ~override Microsoft.Maui.Controls.Compatibility.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.ContentPresenter.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ContentPresenter.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ContentPresenter.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ContentPresenter.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -173,7 +206,12 @@ override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.CanConvert override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.ScrollView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ScrollView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ScrollView.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ScrollView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type? sourceType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object! @@ -193,7 +231,11 @@ override Microsoft.Maui.Controls.Shapes.PathGeometryConverter.ConvertTo(System.C ~override Microsoft.Maui.Controls.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedPage.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.TemplatedView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.TemplatedView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View! child) -> bool +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View! child) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -249,15 +291,22 @@ static Microsoft.Maui.Controls.ViewExtensions.ScaleToAsync(this Microsoft.Maui.C static Microsoft.Maui.Controls.ViewExtensions.ScaleXToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.ScaleYToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.TranslateToAsync(this Microsoft.Maui.Controls.VisualElement! view, double x, double y, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! +~static readonly Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ContentPresenter.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.Button.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.ImageButton.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.WebView.JavaScriptEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverRectProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverSourceViewProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.ReturnTypeProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.SearchIconColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Shell.NavBarVisibilityAnimationEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Switch.OffColorProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.IsClippedToBoundsProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, TPropertyType oldValue, TPropertyType newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangingDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void 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 6701f5cb535b..26d2a5d5a1ed 100644 --- a/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt @@ -1,12 +1,14 @@ -#nullable enable -const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! +#nullable enable Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.GradientBrushParser(Microsoft.Maui.Graphics.Converters.ColorTypeConverter? colorConverter = null) -> void Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.Parse(string? css) -> Microsoft.Maui.Controls.GradientBrush? +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ContentPresenter.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ContentPresenter.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ContentPresenter.Padding.set -> void +~Microsoft.Maui.Controls.ContentPresenter.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime oldDate, System.DateTime newDate) -> void Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime? oldDate, System.DateTime? newDate) -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.NewDate.get -> System.DateTime @@ -38,7 +40,6 @@ Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Subscribe(object subscriber, string message, System.Action callback, TSender source = null) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void -Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.ITextAlignmentElement Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void @@ -52,6 +53,7 @@ Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextT Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void ~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string +Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.Fixed = Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed | Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed -> Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed = 1 -> Microsoft.Maui.Controls.LayoutConstraint @@ -61,15 +63,23 @@ Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed = 2 -> Microsoft.Maui.C *REMOVED*Microsoft.Maui.Controls.MessagingCenter.MessagingCenter() -> void ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, Microsoft.Maui.FlowDirection flowDirection, params string[] buttons) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, params string[] buttons) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.Popover = 5 -> Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Request.get -> Foundation.NSUrlRequest! Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Sender.get -> WebKit.WKWebView! Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.UrlSchemeTask.get -> WebKit.IWKUrlSchemeTask! +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ScrollView.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ScrollView.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ScrollView.Padding.set -> void +~Microsoft.Maui.Controls.ScrollView.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.UpdateChildrenLayout() -> void Microsoft.Maui.Controls.SearchBar.ReturnType.get -> Microsoft.Maui.ReturnType Microsoft.Maui.Controls.SearchBar.ReturnType.set -> void ~Microsoft.Maui.Controls.SearchBar.SearchIconColor.get -> Microsoft.Maui.Graphics.Color @@ -78,6 +88,16 @@ Microsoft.Maui.Controls.ShadowTypeConverter Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void ~Microsoft.Maui.Controls.Switch.OffColor.get -> Microsoft.Maui.Graphics.Color ~Microsoft.Maui.Controls.Switch.OffColor.set -> void +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.set -> void +Microsoft.Maui.Controls.TemplatedView.Children.get -> System.Collections.Generic.IReadOnlyList! +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.get -> bool +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.set -> void +Microsoft.Maui.Controls.TemplatedView.LowerChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.TemplatedView.Padding.set -> void +Microsoft.Maui.Controls.TemplatedView.RaiseChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan? *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.OldTime.get -> System.TimeSpan @@ -93,11 +113,11 @@ Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Headers.get -> Syst Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Method.get -> string! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs? Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.QueryParameters.get -> System.Collections.Generic.IReadOnlyDictionary! -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.IO.Stream? content) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.Threading.Tasks.Task! contentTask) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Uri.get -> System.Uri! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs! platformArgs) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(System.Uri! uri, string! method) -> void @@ -107,6 +127,12 @@ Microsoft.Maui.Controls.Xaml.Internals.AllowImplicitXmlnsDeclarationAttribute.Al ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.Target.get -> string *REMOVED*~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace) -> void ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string target) -> void +const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -121,9 +147,16 @@ override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.Convert override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.Compatibility.AbsoluteLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.Compatibility.Grid.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildAdded(Microsoft.Maui.Controls.Element child) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildRemoved(Microsoft.Maui.Controls.Element child, int oldLogicalIndex) -> void ~override Microsoft.Maui.Controls.Compatibility.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.ContentPresenter.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ContentPresenter.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ContentPresenter.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ContentPresenter.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -173,7 +206,12 @@ override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.CanConvert override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.ScrollView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ScrollView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ScrollView.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ScrollView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type? sourceType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object! @@ -193,7 +231,11 @@ override Microsoft.Maui.Controls.Shapes.PathGeometryConverter.ConvertTo(System.C ~override Microsoft.Maui.Controls.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedPage.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.TemplatedView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.TemplatedView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View! child) -> bool +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View! child) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -249,15 +291,22 @@ static Microsoft.Maui.Controls.ViewExtensions.ScaleToAsync(this Microsoft.Maui.C static Microsoft.Maui.Controls.ViewExtensions.ScaleXToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.ScaleYToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.TranslateToAsync(this Microsoft.Maui.Controls.VisualElement! view, double x, double y, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! +~static readonly Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ContentPresenter.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.Button.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.ImageButton.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.WebView.JavaScriptEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverRectProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverSourceViewProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.ReturnTypeProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.SearchIconColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Shell.NavBarVisibilityAnimationEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Switch.OffColorProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.IsClippedToBoundsProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, TPropertyType oldValue, TPropertyType newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangingDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void 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 b4ad48379ba6..034fd89d8e64 100644 --- a/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txt @@ -1,12 +1,30 @@ -#nullable enable -const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! +#nullable enable Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.GradientBrushParser(Microsoft.Maui.Graphics.Converters.ColorTypeConverter? colorConverter = null) -> void Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.Parse(string? css) -> Microsoft.Maui.Controls.GradientBrush? +*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer +*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.Buttons.get -> Microsoft.Maui.Controls.ButtonsMask +*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.Buttons.set -> void +*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.ClickGestureRecognizer() -> void +*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.Clicked -> System.EventHandler +*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.Command.get -> System.Windows.Input.ICommand +*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.Command.set -> void +*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.CommandParameter.get -> object +*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.CommandParameter.set -> void +*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.NumberOfClicksRequired.get -> int +*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.NumberOfClicksRequired.set -> void +*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.SendClicked(Microsoft.Maui.Controls.View sender, Microsoft.Maui.Controls.ButtonsMask buttons) -> void +*REMOVED*Microsoft.Maui.Controls.ClickedEventArgs +*REMOVED*Microsoft.Maui.Controls.ClickedEventArgs.Buttons.get -> Microsoft.Maui.Controls.ButtonsMask +*REMOVED*~Microsoft.Maui.Controls.ClickedEventArgs.ClickedEventArgs(Microsoft.Maui.Controls.ButtonsMask buttons, object commandParameter) -> void +*REMOVED*~Microsoft.Maui.Controls.ClickedEventArgs.Parameter.get -> object +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ContentPresenter.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ContentPresenter.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ContentPresenter.Padding.set -> void +~Microsoft.Maui.Controls.ContentPresenter.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime oldDate, System.DateTime newDate) -> void Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime? oldDate, System.DateTime? newDate) -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.NewDate.get -> System.DateTime @@ -36,7 +54,6 @@ Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Subscribe(object subscriber, string message, System.Action callback, TSender source = null) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void -Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.ITextAlignmentElement Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void @@ -50,6 +67,7 @@ Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextT Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void ~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string +Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.Fixed = Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed | Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed -> Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed = 1 -> Microsoft.Maui.Controls.LayoutConstraint @@ -59,15 +77,23 @@ Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed = 2 -> Microsoft.Maui.C *REMOVED*Microsoft.Maui.Controls.MessagingCenter.MessagingCenter() -> void ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, Microsoft.Maui.FlowDirection flowDirection, params string[] buttons) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, params string[] buttons) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.Popover = 5 -> Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Request.get -> Microsoft.Web.WebView2.Core.CoreWebView2WebResourceRequest! Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.RequestEventArgs.get -> Microsoft.Web.WebView2.Core.CoreWebView2WebResourceRequestedEventArgs! Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs.Sender.get -> Microsoft.Web.WebView2.Core.CoreWebView2! +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ScrollView.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ScrollView.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ScrollView.Padding.set -> void +~Microsoft.Maui.Controls.ScrollView.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.UpdateChildrenLayout() -> void Microsoft.Maui.Controls.SearchBar.ReturnType.get -> Microsoft.Maui.ReturnType Microsoft.Maui.Controls.SearchBar.ReturnType.set -> void ~Microsoft.Maui.Controls.SearchBar.SearchIconColor.get -> Microsoft.Maui.Graphics.Color @@ -76,6 +102,16 @@ Microsoft.Maui.Controls.ShadowTypeConverter Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void ~Microsoft.Maui.Controls.Switch.OffColor.get -> Microsoft.Maui.Graphics.Color ~Microsoft.Maui.Controls.Switch.OffColor.set -> void +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.set -> void +Microsoft.Maui.Controls.TemplatedView.Children.get -> System.Collections.Generic.IReadOnlyList! +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.get -> bool +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.set -> void +Microsoft.Maui.Controls.TemplatedView.LowerChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.TemplatedView.Padding.set -> void +Microsoft.Maui.Controls.TemplatedView.RaiseChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan? *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.OldTime.get -> System.TimeSpan @@ -91,11 +127,11 @@ Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Headers.get -> Syst Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Method.get -> string! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs? Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.QueryParameters.get -> System.Collections.Generic.IReadOnlyDictionary! -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.IO.Stream? content) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.Threading.Tasks.Task! contentTask) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Uri.get -> System.Uri! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs! platformArgs) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(System.Uri! uri, string! method) -> void @@ -105,6 +141,12 @@ Microsoft.Maui.Controls.Xaml.Internals.AllowImplicitXmlnsDeclarationAttribute.Al ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.Target.get -> string *REMOVED*~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace) -> void ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string target) -> void +const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -119,9 +161,16 @@ override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.Convert override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.Compatibility.AbsoluteLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.Compatibility.Grid.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildAdded(Microsoft.Maui.Controls.Element child) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildRemoved(Microsoft.Maui.Controls.Element child, int oldLogicalIndex) -> void ~override Microsoft.Maui.Controls.Compatibility.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.ContentPresenter.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ContentPresenter.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ContentPresenter.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ContentPresenter.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -168,7 +217,12 @@ override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.CanConvert override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.ScrollView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ScrollView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ScrollView.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ScrollView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type? sourceType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object! @@ -188,7 +242,11 @@ override Microsoft.Maui.Controls.Shapes.PathGeometryConverter.ConvertTo(System.C ~override Microsoft.Maui.Controls.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedPage.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.TemplatedView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.TemplatedView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View! child) -> bool +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View! child) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -244,15 +302,26 @@ static Microsoft.Maui.Controls.ViewExtensions.ScaleToAsync(this Microsoft.Maui.C static Microsoft.Maui.Controls.ViewExtensions.ScaleXToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.ScaleYToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.TranslateToAsync(this Microsoft.Maui.Controls.VisualElement! view, double x, double y, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! +*REMOVED*~static readonly Microsoft.Maui.Controls.ClickGestureRecognizer.ButtonsProperty -> Microsoft.Maui.Controls.BindableProperty +*REMOVED*~static readonly Microsoft.Maui.Controls.ClickGestureRecognizer.CommandParameterProperty -> Microsoft.Maui.Controls.BindableProperty +*REMOVED*~static readonly Microsoft.Maui.Controls.ClickGestureRecognizer.CommandProperty -> Microsoft.Maui.Controls.BindableProperty +*REMOVED*~static readonly Microsoft.Maui.Controls.ClickGestureRecognizer.NumberOfClicksRequiredProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ContentPresenter.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.Button.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.ImageButton.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.WebView.JavaScriptEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverRectProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverSourceViewProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.ReturnTypeProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.SearchIconColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Shell.NavBarVisibilityAnimationEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Switch.OffColorProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.IsClippedToBoundsProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, TPropertyType oldValue, TPropertyType newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangingDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void @@ -267,23 +336,3 @@ virtual Microsoft.Maui.Controls.BindableProperty.CreateDefaultValueDelegate System.Threading.Tasks.Task ~virtual Microsoft.Maui.Controls.PropertyChangingEventHandler.Invoke(object sender, Microsoft.Maui.Controls.PropertyChangingEventArgs e) -> void ~virtual Microsoft.Maui.Controls.VisualElement.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void -*REMOVED*Microsoft.Maui.Controls.ClickedEventArgs -*REMOVED*Microsoft.Maui.Controls.ClickedEventArgs.Buttons.get -> Microsoft.Maui.Controls.ButtonsMask -*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer -*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.Buttons.get -> Microsoft.Maui.Controls.ButtonsMask -*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.Buttons.set -> void -*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.Clicked -> System.EventHandler -*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.ClickGestureRecognizer() -> void -*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.NumberOfClicksRequired.get -> int -*REMOVED*Microsoft.Maui.Controls.ClickGestureRecognizer.NumberOfClicksRequired.set -> void -*REMOVED*~Microsoft.Maui.Controls.ClickedEventArgs.ClickedEventArgs(Microsoft.Maui.Controls.ButtonsMask buttons, object commandParameter) -> void -*REMOVED*~Microsoft.Maui.Controls.ClickedEventArgs.Parameter.get -> object -*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.Command.get -> System.Windows.Input.ICommand -*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.Command.set -> void -*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.CommandParameter.get -> object -*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.CommandParameter.set -> void -*REMOVED*~Microsoft.Maui.Controls.ClickGestureRecognizer.SendClicked(Microsoft.Maui.Controls.View sender, Microsoft.Maui.Controls.ButtonsMask buttons) -> void -*REMOVED*~static readonly Microsoft.Maui.Controls.ClickGestureRecognizer.ButtonsProperty -> Microsoft.Maui.Controls.BindableProperty -*REMOVED*~static readonly Microsoft.Maui.Controls.ClickGestureRecognizer.CommandParameterProperty -> Microsoft.Maui.Controls.BindableProperty -*REMOVED*~static readonly Microsoft.Maui.Controls.ClickGestureRecognizer.CommandProperty -> Microsoft.Maui.Controls.BindableProperty -*REMOVED*~static readonly Microsoft.Maui.Controls.ClickGestureRecognizer.NumberOfClicksRequiredProperty -> 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 8248a97ee7c1..4bb32c6a09bf 100644 --- a/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txt @@ -1,12 +1,14 @@ -#nullable enable -const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! +#nullable enable Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.GradientBrushParser(Microsoft.Maui.Graphics.Converters.ColorTypeConverter? colorConverter = null) -> void Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.Parse(string? css) -> Microsoft.Maui.Controls.GradientBrush? +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ContentPresenter.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ContentPresenter.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ContentPresenter.Padding.set -> void +~Microsoft.Maui.Controls.ContentPresenter.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime oldDate, System.DateTime newDate) -> void Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime? oldDate, System.DateTime? newDate) -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.NewDate.get -> System.DateTime @@ -36,7 +38,6 @@ Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Subscribe(object subscriber, string message, System.Action callback, TSender source = null) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void -Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.ITextAlignmentElement Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void @@ -50,6 +51,7 @@ Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextT Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void ~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string +Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.Fixed = Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed | Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed -> Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed = 1 -> Microsoft.Maui.Controls.LayoutConstraint @@ -59,12 +61,20 @@ Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed = 2 -> Microsoft.Maui.C *REMOVED*Microsoft.Maui.Controls.MessagingCenter.MessagingCenter() -> void ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, Microsoft.Maui.FlowDirection flowDirection, params string[] buttons) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, params string[] buttons) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.Popover = 5 -> Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ScrollView.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ScrollView.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ScrollView.Padding.set -> void +~Microsoft.Maui.Controls.ScrollView.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.UpdateChildrenLayout() -> void Microsoft.Maui.Controls.SearchBar.ReturnType.get -> Microsoft.Maui.ReturnType Microsoft.Maui.Controls.SearchBar.ReturnType.set -> void ~Microsoft.Maui.Controls.SearchBar.SearchIconColor.get -> Microsoft.Maui.Graphics.Color @@ -73,6 +83,16 @@ Microsoft.Maui.Controls.ShadowTypeConverter Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void ~Microsoft.Maui.Controls.Switch.OffColor.get -> Microsoft.Maui.Graphics.Color ~Microsoft.Maui.Controls.Switch.OffColor.set -> void +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.set -> void +Microsoft.Maui.Controls.TemplatedView.Children.get -> System.Collections.Generic.IReadOnlyList! +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.get -> bool +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.set -> void +Microsoft.Maui.Controls.TemplatedView.LowerChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.TemplatedView.Padding.set -> void +Microsoft.Maui.Controls.TemplatedView.RaiseChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan? *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.OldTime.get -> System.TimeSpan @@ -88,11 +108,11 @@ Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Headers.get -> Syst Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Method.get -> string! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs? Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.QueryParameters.get -> System.Collections.Generic.IReadOnlyDictionary! -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.IO.Stream? content) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.Threading.Tasks.Task! contentTask) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Uri.get -> System.Uri! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs! platformArgs) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(System.Uri! uri, string! method) -> void @@ -102,6 +122,12 @@ Microsoft.Maui.Controls.Xaml.Internals.AllowImplicitXmlnsDeclarationAttribute.Al ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.Target.get -> string *REMOVED*~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace) -> void ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string target) -> void +const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -116,9 +142,16 @@ override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.Convert override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.Compatibility.AbsoluteLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.Compatibility.Grid.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildAdded(Microsoft.Maui.Controls.Element child) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildRemoved(Microsoft.Maui.Controls.Element child, int oldLogicalIndex) -> void ~override Microsoft.Maui.Controls.Compatibility.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.ContentPresenter.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ContentPresenter.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ContentPresenter.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ContentPresenter.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -165,7 +198,12 @@ override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.CanConvert override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.ScrollView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ScrollView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ScrollView.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ScrollView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type? sourceType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object! @@ -185,7 +223,11 @@ override Microsoft.Maui.Controls.Shapes.PathGeometryConverter.ConvertTo(System.C ~override Microsoft.Maui.Controls.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedPage.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.TemplatedView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.TemplatedView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View! child) -> bool +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View! child) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -237,15 +279,22 @@ static Microsoft.Maui.Controls.ViewExtensions.ScaleToAsync(this Microsoft.Maui.C static Microsoft.Maui.Controls.ViewExtensions.ScaleXToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.ScaleYToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.TranslateToAsync(this Microsoft.Maui.Controls.VisualElement! view, double x, double y, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! +~static readonly Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ContentPresenter.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.Button.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.ImageButton.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.WebView.JavaScriptEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverRectProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverSourceViewProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.ReturnTypeProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.SearchIconColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Shell.NavBarVisibilityAnimationEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Switch.OffColorProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.IsClippedToBoundsProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, TPropertyType oldValue, TPropertyType newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangingDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void diff --git a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt index 8248a97ee7c1..4bb32c6a09bf 100644 --- a/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt +++ b/src/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txt @@ -1,12 +1,14 @@ -#nullable enable -const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! -const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! +#nullable enable Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.GradientBrushParser(Microsoft.Maui.Graphics.Converters.ColorTypeConverter? colorConverter = null) -> void Microsoft.Maui.Controls.BrushTypeConverter.GradientBrushParser.Parse(string? css) -> Microsoft.Maui.Controls.GradientBrush? +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ContentPresenter.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ContentPresenter.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ContentPresenter.Padding.set -> void +~Microsoft.Maui.Controls.ContentPresenter.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ContentPresenter.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime oldDate, System.DateTime newDate) -> void Microsoft.Maui.Controls.DateChangedEventArgs.DateChangedEventArgs(System.DateTime? oldDate, System.DateTime? newDate) -> void *REMOVED*Microsoft.Maui.Controls.DateChangedEventArgs.NewDate.get -> System.DateTime @@ -36,7 +38,6 @@ Microsoft.Maui.Controls.ILineHeightElement.OnLineHeightChanged(double oldValue, *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Subscribe(object subscriber, string message, System.Action callback, TSender source = null) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void *REMOVED*~Microsoft.Maui.Controls.IMessagingCenter.Unsubscribe(object subscriber, string message) -> void -Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.ITextAlignmentElement Microsoft.Maui.Controls.ITextAlignmentElement.HorizontalTextAlignment.get -> Microsoft.Maui.TextAlignment Microsoft.Maui.Controls.ITextAlignmentElement.OnHorizontalTextAlignmentPropertyChanged(Microsoft.Maui.TextAlignment oldValue, Microsoft.Maui.TextAlignment newValue) -> void @@ -50,6 +51,7 @@ Microsoft.Maui.Controls.ITextElement.OnTextTransformChanged(Microsoft.Maui.TextT Microsoft.Maui.Controls.ITextElement.TextTransform.get -> Microsoft.Maui.TextTransform Microsoft.Maui.Controls.ITextElement.TextTransform.set -> void ~Microsoft.Maui.Controls.ITextElement.UpdateFormsText(string original, Microsoft.Maui.TextTransform transform) -> string +Microsoft.Maui.Controls.Internals.TextTransformUtilities Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.Fixed = Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed | Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed -> Microsoft.Maui.Controls.LayoutConstraint Microsoft.Maui.Controls.LayoutConstraint.HorizontallyFixed = 1 -> Microsoft.Maui.Controls.LayoutConstraint @@ -59,12 +61,20 @@ Microsoft.Maui.Controls.LayoutConstraint.VerticallyFixed = 2 -> Microsoft.Maui.C *REMOVED*Microsoft.Maui.Controls.MessagingCenter.MessagingCenter() -> void ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, Microsoft.Maui.FlowDirection flowDirection, params string[] buttons) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayActionSheetAsync(string title, string cancel, string destruction, params string[] buttons) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel) -> System.Threading.Tasks.Task -~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string accept, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task ~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel) -> System.Threading.Tasks.Task +~Microsoft.Maui.Controls.Page.DisplayAlertAsync(string title, string message, string cancel, Microsoft.Maui.FlowDirection flowDirection) -> System.Threading.Tasks.Task Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle.Popover = 5 -> Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.UIModalPresentationStyle Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.ScrollView.CascadeInputTransparent.set -> void +~Microsoft.Maui.Controls.ScrollView.Children.get -> System.Collections.Generic.IReadOnlyList +~Microsoft.Maui.Controls.ScrollView.LowerChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.ScrollView.Padding.set -> void +~Microsoft.Maui.Controls.ScrollView.RaiseChild(Microsoft.Maui.Controls.View view) -> void +Microsoft.Maui.Controls.ScrollView.UpdateChildrenLayout() -> void Microsoft.Maui.Controls.SearchBar.ReturnType.get -> Microsoft.Maui.ReturnType Microsoft.Maui.Controls.SearchBar.ReturnType.set -> void ~Microsoft.Maui.Controls.SearchBar.SearchIconColor.get -> Microsoft.Maui.Graphics.Color @@ -73,6 +83,16 @@ Microsoft.Maui.Controls.ShadowTypeConverter Microsoft.Maui.Controls.ShadowTypeConverter.ShadowTypeConverter() -> void ~Microsoft.Maui.Controls.Switch.OffColor.get -> Microsoft.Maui.Graphics.Color ~Microsoft.Maui.Controls.Switch.OffColor.set -> void +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.get -> bool +Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparent.set -> void +Microsoft.Maui.Controls.TemplatedView.Children.get -> System.Collections.Generic.IReadOnlyList! +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.get -> bool +Microsoft.Maui.Controls.TemplatedView.IsClippedToBounds.set -> void +Microsoft.Maui.Controls.TemplatedView.LowerChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.Padding.get -> Microsoft.Maui.Thickness +Microsoft.Maui.Controls.TemplatedView.Padding.set -> void +Microsoft.Maui.Controls.TemplatedView.RaiseChild(Microsoft.Maui.Controls.View! view) -> void +Microsoft.Maui.Controls.TemplatedView.UpdateChildrenLayout() -> void *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan Microsoft.Maui.Controls.TimeChangedEventArgs.NewTime.get -> System.TimeSpan? *REMOVED*Microsoft.Maui.Controls.TimeChangedEventArgs.OldTime.get -> System.TimeSpan @@ -88,11 +108,11 @@ Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Headers.get -> Syst Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Method.get -> string! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.PlatformArgs.get -> Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs? Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.QueryParameters.get -> System.Collections.Generic.IReadOnlyDictionary! -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.IO.Stream? content) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, System.Collections.Generic.IReadOnlyDictionary? headers, System.Threading.Tasks.Task! contentTask) -> void -Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.IO.Stream? content) -> void +Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.SetResponse(int code, string! reason, string! contentType, System.Threading.Tasks.Task! contentTask) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.Uri.get -> System.Uri! Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(Microsoft.Maui.Controls.PlatformWebViewWebResourceRequestedEventArgs! platformArgs) -> void Microsoft.Maui.Controls.WebViewWebResourceRequestedEventArgs.WebViewWebResourceRequestedEventArgs(System.Uri! uri, string! method) -> void @@ -102,6 +122,12 @@ Microsoft.Maui.Controls.Xaml.Internals.AllowImplicitXmlnsDeclarationAttribute.Al ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.Target.get -> string *REMOVED*~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string clrNamespace) -> void ~Microsoft.Maui.Controls.XmlnsDefinitionAttribute.XmlnsDefinitionAttribute(string xmlNamespace, string target) -> void +const Microsoft.Maui.Controls.BrushTypeConverter.Hsl = "hsl" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Hsla = "hsla" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.LinearGradient = "linear-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.RadialGradient = "radial-gradient" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgb = "rgb" -> string! +const Microsoft.Maui.Controls.BrushTypeConverter.Rgba = "rgba" -> string! override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.AcceleratorTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -116,9 +142,16 @@ override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.Convert override Microsoft.Maui.Controls.ColumnDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.Compatibility.AbsoluteLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.Compatibility.Grid.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildAdded(Microsoft.Maui.Controls.Element child) -> void +~override Microsoft.Maui.Controls.Compatibility.Layout.OnChildRemoved(Microsoft.Maui.Controls.Element child, int oldLogicalIndex) -> void ~override Microsoft.Maui.Controls.Compatibility.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.ContentPresenter.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ContentPresenter.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ContentPresenter.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ContentPresenter.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ContentPresenter.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ContentPresenter.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.DoubleCollectionConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -165,7 +198,12 @@ override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.CanConvert override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? override Microsoft.Maui.Controls.RowDefinitionCollectionTypeConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object? value, System.Type! destinationType) -> object? ~override Microsoft.Maui.Controls.ScrollView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.ScrollView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.ScrollView.Measure(double widthConstraint, double heightConstraint, Microsoft.Maui.Controls.MeasureFlags flags = Microsoft.Maui.Controls.MeasureFlags.None) -> Microsoft.Maui.SizeRequest +override Microsoft.Maui.Controls.ScrollView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.ScrollView.OnSizeAllocated(double width, double height) -> void +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View child) -> bool +~override Microsoft.Maui.Controls.ScrollView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View child) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type? sourceType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.ShadowTypeConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object! @@ -185,7 +223,11 @@ override Microsoft.Maui.Controls.Shapes.PathGeometryConverter.ConvertTo(System.C ~override Microsoft.Maui.Controls.StackLayout.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedPage.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void ~override Microsoft.Maui.Controls.TemplatedView.ComputeConstraintForView(Microsoft.Maui.Controls.View view) -> void +override Microsoft.Maui.Controls.TemplatedView.InvalidateLayout() -> void +override Microsoft.Maui.Controls.TemplatedView.OnChildMeasureInvalidated() -> void override Microsoft.Maui.Controls.TemplatedView.OnSizeAllocated(double width, double height) -> void +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildAdded(Microsoft.Maui.Controls.View! child) -> bool +override Microsoft.Maui.Controls.TemplatedView.ShouldInvalidateOnChildRemoved(Microsoft.Maui.Controls.View! child) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Type! sourceType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.CanConvertTo(System.ComponentModel.ITypeDescriptorContext? context, System.Type? destinationType) -> bool override Microsoft.Maui.Controls.TextDecorationConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext? context, System.Globalization.CultureInfo? culture, object! value) -> object? @@ -237,15 +279,22 @@ static Microsoft.Maui.Controls.ViewExtensions.ScaleToAsync(this Microsoft.Maui.C static Microsoft.Maui.Controls.ViewExtensions.ScaleXToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.ScaleYToAsync(this Microsoft.Maui.Controls.VisualElement! view, double scale, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! static Microsoft.Maui.Controls.ViewExtensions.TranslateToAsync(this Microsoft.Maui.Controls.VisualElement! view, double x, double y, uint length = 250, Microsoft.Maui.Easing? easing = null) -> System.Threading.Tasks.Task! +~static readonly Microsoft.Maui.Controls.ContentPresenter.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ContentPresenter.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.Button.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.ImageButton.RippleColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.AndroidSpecific.WebView.JavaScriptEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverRectProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific.Page.ModalPopoverSourceViewProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.ScrollView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.ReturnTypeProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.SearchBar.SearchIconColorProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Shell.NavBarVisibilityAnimationEnabledProperty -> Microsoft.Maui.Controls.BindableProperty ~static readonly Microsoft.Maui.Controls.Switch.OffColorProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.CascadeInputTransparentProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.IsClippedToBoundsProperty -> Microsoft.Maui.Controls.BindableProperty +~static readonly Microsoft.Maui.Controls.TemplatedView.PaddingProperty -> Microsoft.Maui.Controls.BindableProperty ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangedDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, TPropertyType oldValue, TPropertyType newValue) -> void ~virtual Microsoft.Maui.Controls.BindableProperty.BindingPropertyChangingDelegate.Invoke(Microsoft.Maui.Controls.BindableObject bindable, object oldValue, object newValue) -> void diff --git a/src/Controls/src/Core/ScrollView/ScrollView.cs b/src/Controls/src/Core/ScrollView/ScrollView.cs index 838b04ab8d72..9b27c9825d39 100644 --- a/src/Controls/src/Core/ScrollView/ScrollView.cs +++ b/src/Controls/src/Core/ScrollView/ScrollView.cs @@ -1,10 +1,9 @@ #nullable disable using System; +using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Threading.Tasks; -using Microsoft.Maui.Controls.Internals; - using Microsoft.Maui.Graphics; using Microsoft.Maui.Layouts; @@ -12,16 +11,16 @@ namespace Microsoft.Maui.Controls { /// [ContentProperty(nameof(Content))] -#pragma warning disable CS0618 // Type or member is obsolete [DebuggerDisplay("{GetDebuggerDisplay(), nq}")] - public partial class ScrollView : Compatibility.Layout, IScrollViewController, IElementConfiguration, IFlowDirectionController, IScrollView, IContentView +#pragma warning disable CS0618 // Type or member is obsolete + public partial class ScrollView : Compatibility.Layout, ILayout, ILayoutController, IPaddingElement, IView, IVisualTreeElement, IInputTransparentContainerElement, IScrollViewController, IElementConfiguration, IFlowDirectionController, IScrollView, IContentView #pragma warning restore CS0618 // Type or member is obsolete { #region IScrollViewController /// [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete] + [Obsolete("This API doesn't do anything", true)] public Rect LayoutAreaOverride { get => _layoutAreaOverride; @@ -30,8 +29,6 @@ public Rect LayoutAreaOverride if (_layoutAreaOverride == value) return; _layoutAreaOverride = value; - // Dont invalidate here, we can relayout immediately since this only impacts our innards - UpdateChildrenLayout(); } } @@ -143,6 +140,7 @@ public void SetScrolledPosition(double x, double y) View _content; TaskCompletionSource _scrollCompletionSource; Rect _layoutAreaOverride; + IReadOnlyList ILayoutController.Children => LogicalChildrenInternal; /// public View Content @@ -154,15 +152,15 @@ public View Content return; OnPropertyChanging(); - if (_content != null) + if (_content is not null) { _content.SizeChanged -= ContentSizeChanged; - InternalChildren.Remove(_content); + RemoveLogicalChild(_content); } _content = value; - if (_content != null) + if (_content is not null) { - InternalChildren.Add(_content); + AddLogicalChild(_content); _content.SizeChanged += ContentSizeChanged; } @@ -171,10 +169,34 @@ public View Content } } + /// Bindable property for . + public new static readonly BindableProperty CascadeInputTransparentProperty = InputTransparentContainerElement.CascadeInputTransparentProperty; + + /// + public new bool CascadeInputTransparent + { + get => (bool)GetValue(InputTransparentContainerElement.CascadeInputTransparentProperty); + set => SetValue(InputTransparentContainerElement.CascadeInputTransparentProperty, value); + } + + /// Bindable property for . + public new static readonly BindableProperty PaddingProperty = PaddingElement.PaddingProperty; + + /// + public new Thickness Padding + { + get => (Thickness)GetValue(PaddingProperty); + set => SetValue(PaddingProperty, value); + } + + Thickness IPaddingElement.PaddingDefaultValueCreator() => default(Thickness); + + void IPaddingElement.OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue) => InvalidateMeasure(); + void ContentSizeChanged(object sender, EventArgs e) { var view = (sender as IView); - if (view == null) + if (view is null) { ContentSize = Size.Zero; return; @@ -248,7 +270,9 @@ public IPlatformElementConfiguration On() where T : IConfigPla public Task ScrollToAsync(double x, double y, bool animated) { if (Orientation == ScrollOrientation.Neither) + { return Task.FromResult(false); + } var args = new ScrollToRequestedEventArgs(x, y, animated); OnScrollToRequested(args); @@ -259,16 +283,24 @@ public Task ScrollToAsync(double x, double y, bool animated) public Task ScrollToAsync(Element element, ScrollToPosition position, bool animated) { if (Orientation == ScrollOrientation.Neither) + { return Task.FromResult(false); + } if (!Enum.IsDefined(typeof(ScrollToPosition), position)) + { throw new ArgumentException("position is not a valid ScrollToPosition", nameof(position)); + } - if (element == null) + if (element is null) + { throw new ArgumentNullException(nameof(element)); + } if (!CheckElementBelongsToScrollViewer(element)) + { throw new ArgumentException("element does not belong to this ScrollView", nameof(element)); + } var args = new ScrollToRequestedEventArgs(element, position, animated); OnScrollToRequested(args); @@ -277,51 +309,6 @@ public Task ScrollToAsync(Element element, ScrollToPosition position, bool anima bool IFlowDirectionController.ApplyEffectiveFlowDirectionToChildContainer => false; - [Obsolete("Use ArrangeOverride instead")] - protected override void LayoutChildren(double x, double y, double width, double height) - { - } - - [Obsolete("Use MeasureOverride instead")] - protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint) - { - if (Content == null) - return new SizeRequest(); - - switch (Orientation) - { - case ScrollOrientation.Horizontal: - widthConstraint = double.PositiveInfinity; - break; - case ScrollOrientation.Vertical: - heightConstraint = double.PositiveInfinity; - break; - case ScrollOrientation.Both: - widthConstraint = double.PositiveInfinity; - heightConstraint = double.PositiveInfinity; - break; - case ScrollOrientation.Neither: - widthConstraint = Width; - heightConstraint = Height; - break; - } - - SizeRequest contentRequest; - - if (Content is IView fe && fe.Handler != null) - { - contentRequest = fe.Measure(widthConstraint, heightConstraint); - } - else - { - contentRequest = Content.Measure(widthConstraint, heightConstraint, MeasureFlags.IncludeMargins); - } - - contentRequest.Minimum = new Size(Math.Min(40, contentRequest.Minimum.Width), Math.Min(40, contentRequest.Minimum.Height)); - - return contentRequest; - } - protected override void ComputeConstraintForView(View view) { switch (Orientation) @@ -348,12 +335,12 @@ protected override void ComputeConstraintForView(View view) bool CheckElementBelongsToScrollViewer(Element element) { - return Equals(element, this) || element.RealParent != null && CheckElementBelongsToScrollViewer(element.RealParent); + return Equals(element, this) || element.RealParent is not null && CheckElementBelongsToScrollViewer(element.RealParent); } void CheckTaskCompletionSource() { - if (_scrollCompletionSource != null && _scrollCompletionSource.Task.Status == TaskStatus.Running) + if (_scrollCompletionSource is not null && _scrollCompletionSource.Task.Status == TaskStatus.Running) { _scrollCompletionSource.TrySetCanceled(); } @@ -363,10 +350,13 @@ void CheckTaskCompletionSource() double GetCoordinate(Element item, string coordinateName, double coordinate) { if (item == this) + { return coordinate; + } + coordinate += (double)typeof(VisualElement).GetProperty(coordinateName).GetValue(item, null); var visualParentElement = item.RealParent as VisualElement; - return visualParentElement != null ? GetCoordinate(visualParentElement, coordinateName, coordinate) : coordinate; + return visualParentElement is not null ? GetCoordinate(visualParentElement, coordinateName, coordinate) : coordinate; } void OnScrollToRequested(ScrollToRequestedEventArgs e) @@ -375,9 +365,13 @@ void OnScrollToRequested(ScrollToRequestedEventArgs e) ScrollToRequested?.Invoke(this, e); if (Handler is null) + { _pendingScrollToRequested = e; + } else + { Handler.Invoke(nameof(IScrollView.RequestScrollTo), ConvertRequestMode(e).ToRequest()); + } } ScrollToRequestedEventArgs ConvertRequestMode(ScrollToRequestedEventArgs args) @@ -393,6 +387,7 @@ ScrollToRequestedEventArgs ConvertRequestMode(ScrollToRequestedEventArgs args) } object IContentView.Content => Content; + IView IContentView.PresentedContent => Content; double IScrollView.HorizontalOffset @@ -494,10 +489,104 @@ Size ICrossPlatformLayout.CrossPlatformArrange(Rect bounds) return bounds.Size; } + Size IContentView.CrossPlatformMeasure(double widthConstraint, double heightConstraint) => ((ICrossPlatformLayout)this).CrossPlatformMeasure(widthConstraint, heightConstraint); + + Size IContentView.CrossPlatformArrange(Rect bounds) => + ((ICrossPlatformLayout)this).CrossPlatformArrange(bounds); + private protected override string GetDebuggerDisplay() { var debugText = DebuggerDisplayHelpers.GetDebugText(nameof(Content), Content); return $"{base.GetDebuggerDisplay()}, {debugText}"; } + + [Obsolete("Use ArrangeOverride instead")] + protected override void LayoutChildren(double x, double y, double width, double height) + { + } + + [Obsolete("Use Measure with no flags.")] + public override SizeRequest Measure(double widthConstraint, double heightConstraint, MeasureFlags flags = MeasureFlags.None) + { + return base.Measure(widthConstraint, heightConstraint); + } + + + /// + /// Sends a child to the back of the visual stack. + /// + /// The view to lower in the visual stack. + /// Children are internally stored in visual stack order. + /// This means that raising or lowering a child also changes the order in which the children are enumerated. + [Obsolete("Use the ZIndex Property instead")] + public new void LowerChild(View view) + { + base.LowerChild(view); + } + + /// + /// Sends a child to the front of the visual stack. + /// + /// The view to raise in the visual stack. + /// Children are internally stored in visual stack order. + /// This means that raising or lowering a child also changes the order in which the children are enumerated. + [Obsolete("Use the ZIndex Property instead")] + public new void RaiseChild(View view) + { + base.RaiseChild(view); + } + + /// + /// Invalidates the current layout. + /// + /// Calling this method will invalidate the measure and triggers a new layout cycle. + [Obsolete("Use InvalidateMeasure depending on your scenario")] + protected override void InvalidateLayout() + { + base.InvalidateLayout(); + } + + /// + /// Invoked whenever a child of the layout has emitted . + /// Implement this method to add class handling for this event. + /// + [Obsolete("Subscribe to the MeasureInvalidated Event on the Children.")] + protected override void OnChildMeasureInvalidated() + { + } + + /// + /// If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later. + /// + /// The child for which to specify whether or not to track invalidation. + /// if should call , otherwise . + [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later.")] + protected override bool ShouldInvalidateOnChildAdded(View child) => true; + + /// + /// If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later. + /// + /// The child for which to specify whether or not to track invalidation. + /// if should call , otherwise . + [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later.")] + protected override bool ShouldInvalidateOnChildRemoved(View child) => true; + + /// + /// Use InvalidateMeasure depending on your scenario. This method will no longer work on .NET 10 and later. + /// + [Obsolete("Use InvalidateMeasure depending on your scenario. This method will no longer work on .NET 10 and later.")] + protected new void UpdateChildrenLayout() + { + } + + [Obsolete("Use MeasureOverride instead")] + protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint) + { + return base.OnMeasure(widthConstraint, heightConstraint); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Use IVisualTreeElement.GetVisualChildren() instead.", true)] + public new IReadOnlyList Children => base.Children; } -} +} \ No newline at end of file diff --git a/src/Controls/src/Core/Shell/ShellContent.cs b/src/Controls/src/Core/Shell/ShellContent.cs index d70fe0d38eac..0149d6a29d7a 100644 --- a/src/Controls/src/Core/Shell/ShellContent.cs +++ b/src/Controls/src/Core/Shell/ShellContent.cs @@ -122,7 +122,14 @@ public ShellContent() ((INotifyCollectionChanged)MenuItems).CollectionChanged += MenuItemsCollectionChanged; } - internal bool IsVisibleContent => Parent is ShellSection shellSection && shellSection.IsVisibleSection && shellSection.CurrentItem == this; + internal bool IsVisibleContent => + Parent is ShellSection shellSection && + shellSection.IsVisibleSection && + shellSection.CurrentItem == this && + ( + Navigation?.ModalStack is null || + Navigation?.ModalStack?.Count == 0 + ); internal override void SendDisappearing() { diff --git a/src/Controls/src/Core/SwipeView/SwipeView.cs b/src/Controls/src/Core/SwipeView/SwipeView.cs index 96f826e79df9..60c01f1c73fb 100644 --- a/src/Controls/src/Core/SwipeView/SwipeView.cs +++ b/src/Controls/src/Core/SwipeView/SwipeView.cs @@ -110,7 +110,7 @@ bool ISwipeViewController.IsOpen elements.Add(TopItems); elements.Add(BottomItems); - foreach (var item in InternalChildren) + foreach (var item in LogicalChildrenInternal) { if (item is IVisualTreeElement vte) { diff --git a/src/Controls/src/Core/TemplateUtilities.cs b/src/Controls/src/Core/TemplateUtilities.cs index ec35e258ae8c..d548f3b34254 100644 --- a/src/Controls/src/Core/TemplateUtilities.cs +++ b/src/Controls/src/Core/TemplateUtilities.cs @@ -61,11 +61,11 @@ public static void OnContentChanged(BindableObject bindable, object oldValue, ob { while (self.InternalChildren.Count > 0) { - self.InternalChildren.RemoveAt(self.InternalChildren.Count - 1); + self.RemoveAt(self.InternalChildren.Count - 1); } if (newValue != null) - self.InternalChildren.Add(newElement); + self.AddLogicalChild(newElement); } else { @@ -107,7 +107,7 @@ public static void OnControlTemplateChanged(BindableObject bindable, object oldV // Now remove all remnants of any other children just to be sure while (self.InternalChildren.Count > 0) { - self.InternalChildren.RemoveAt(self.InternalChildren.Count - 1); + self.RemoveAt(self.InternalChildren.Count - 1); } ControlTemplate template = self.ControlTemplate; @@ -123,7 +123,7 @@ public static void OnControlTemplateChanged(BindableObject bindable, object oldV throw new NotSupportedException("ControlTemplate must return a type derived from View."); } - self.InternalChildren.Add(content); + self.AddLogicalChild(content); var controlTemplated = (IControlTemplated)bindable; controlTemplated.OnControlTemplateChanged((ControlTemplate)oldValue, (ControlTemplate)newValue); controlTemplated.TemplateRoot = content; diff --git a/src/Controls/src/Core/TemplatedPage.cs b/src/Controls/src/Core/TemplatedPage.cs index 0e86062d64b1..b1ff61d9d225 100644 --- a/src/Controls/src/Core/TemplatedPage.cs +++ b/src/Controls/src/Core/TemplatedPage.cs @@ -19,7 +19,7 @@ public ControlTemplate ControlTemplate set { SetValue(ControlTemplateProperty, value); } } - IList IControlTemplated.InternalChildren => InternalChildren; + IReadOnlyList IControlTemplated.InternalChildren => InternalChildren; Element IControlTemplated.TemplateRoot { get; set; } @@ -73,5 +73,26 @@ protected override void OnChildRemoved(Element child, int oldLogicalIndex) } protected object GetTemplateChild(string name) => TemplateUtilities.GetTemplateChild(this, name); + + bool IControlTemplated.RemoveAt(int index) + { + var ct = (IControlTemplated)this; + var view = ct.InternalChildren[index]; + if (InternalChildren.Contains(view)) + { + InternalChildren.Remove(view); + return true; + } + + return RemoveLogicalChild(ct.InternalChildren[index], index); + } + + void IControlTemplated.AddLogicalChild(Element element) + { + if (!InternalChildren.Contains(element)) + { + InternalChildren.Add(element); + } + } } } \ No newline at end of file diff --git a/src/Controls/src/Core/TemplatedView/TemplatedView.cs b/src/Controls/src/Core/TemplatedView/TemplatedView.cs index 409fcc49c7da..b019a0ebdf19 100644 --- a/src/Controls/src/Core/TemplatedView/TemplatedView.cs +++ b/src/Controls/src/Core/TemplatedView/TemplatedView.cs @@ -1,67 +1,82 @@ #nullable disable using System; using System.Collections.Generic; -using Microsoft.Maui.Controls.Internals; +using System.Collections.ObjectModel; +using System.ComponentModel; using Microsoft.Maui.Graphics; using Microsoft.Maui.Layouts; namespace Microsoft.Maui.Controls { - /// + /// + /// A view that displays content with a control template, and the base class for . + /// #pragma warning disable CS0618 // Type or member is obsolete - public partial class TemplatedView : Compatibility.Layout, IControlTemplated, IContentView -#pragma warning restore CS0618 // Type or member is obsolete + public partial class TemplatedView : Compatibility.Layout, ILayout, ILayoutController, IPaddingElement, IView, IVisualTreeElement, IInputTransparentContainerElement, IControlTemplated, IContentView, IClippedToBoundsElement { +#pragma warning restore CS0618 /// Bindable property for . public static readonly BindableProperty ControlTemplateProperty = BindableProperty.Create(nameof(ControlTemplate), typeof(ControlTemplate), typeof(TemplatedView), null, propertyChanged: TemplateUtilities.OnControlTemplateChanged); - /// + /// Bindable property for . + public new static readonly BindableProperty IsClippedToBoundsProperty = + ClippedToBoundsElement.IsClippedToBoundsProperty; + + /// + public new bool IsClippedToBounds + { + get => (bool)GetValue(IsClippedToBoundsProperty); + set => SetValue(IsClippedToBoundsProperty, value); + } + + /// + /// Gets or sets the control template that is used to display content. + /// This is a bindable property. + /// public ControlTemplate ControlTemplate { get { return (ControlTemplate)GetValue(ControlTemplateProperty); } set { SetValue(ControlTemplateProperty, value); } } - IList IControlTemplated.InternalChildren => InternalChildren; + /// Bindable property for . + public new static readonly BindableProperty CascadeInputTransparentProperty = InputTransparentContainerElement.CascadeInputTransparentProperty; - Element IControlTemplated.TemplateRoot { get; set; } - - [Obsolete("Use InvalidateArrange if you need to trigger a new arrange and then put your arrange logic inside ArrangeOverride instead")] - protected override void LayoutChildren(double x, double y, double width, double height) + /// + public new bool CascadeInputTransparent { - for (var i = 0; i < LogicalChildrenInternal.Count; i++) - { - Element element = LogicalChildrenInternal[i]; - var child = element as View; - - // For now we just leave the old path in place to avoid too much change in behavior - // All of our types that inherit from TemplatedView overrides LayoutChildren and replaces - // this behavior - if (child != null) - LayoutChildIntoBoundingRegion(child, new Rect(x, y, width, height)); - } + get => (bool)GetValue(CascadeInputTransparentProperty); + set => SetValue(CascadeInputTransparentProperty, value); } - [Obsolete("Use MeasureOverride instead")] - protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint) + /// + /// The backing store for the bindable property. + /// + public new static readonly BindableProperty PaddingProperty = PaddingElement.PaddingProperty; + + /// + public new Thickness Padding { - double widthRequest = WidthRequest; - double heightRequest = HeightRequest; - var childRequest = new SizeRequest(); + get => (Thickness)GetValue(PaddingProperty); + set => SetValue(PaddingProperty, value); + } - if ((widthRequest == -1 || heightRequest == -1) && InternalChildren.Count > 0 && InternalChildren[0] is View view) - { - childRequest = view.Measure(widthConstraint, heightConstraint, MeasureFlags.IncludeMargins); - } + Thickness IPaddingElement.PaddingDefaultValueCreator() => default; - return new SizeRequest - { - Request = new Size { Width = widthRequest != -1 ? widthRequest : childRequest.Request.Width, Height = heightRequest != -1 ? heightRequest : childRequest.Request.Height }, - Minimum = childRequest.Minimum - }; + void IPaddingElement.OnPaddingPropertyChanged(Thickness oldValue, Thickness newValue) => InvalidateMeasure(); + + IReadOnlyList ILayoutController.Children => LogicalChildrenInternal; + + IReadOnlyList IControlTemplated.InternalChildren => LogicalChildrenInternal; + + bool IControlTemplated.RemoveAt(int index) + { + return RemoveLogicalChild(LogicalChildrenInternalBackingStore[index], index); } + Element IControlTemplated.TemplateRoot { get; set; } + protected override void ComputeConstraintForView(View view) { bool isFixedHorizontally = (Constraint & LayoutConstraint.HorizontallyFixed) != 0; @@ -69,16 +84,24 @@ protected override void ComputeConstraintForView(View view) var result = LayoutConstraint.None; if (isFixedVertically && view.VerticalOptions.Alignment == LayoutAlignment.Fill) + { result |= LayoutConstraint.VerticallyFixed; + } + if (isFixedHorizontally && view.HorizontalOptions.Alignment == LayoutAlignment.Fill) + { result |= LayoutConstraint.HorizontallyFixed; + } + view.ComputedConstraint = result; } internal override void SetChildInheritedBindingContext(Element child, object context) { - if (ControlTemplate == null) + if (ControlTemplate is null) + { base.SetChildInheritedBindingContext(child, context); + } } void IControlTemplated.OnControlTemplateChanged(ControlTemplate oldValue, ControlTemplate newValue) @@ -110,7 +133,10 @@ protected override void OnChildRemoved(Element child, int oldLogicalIndex) protected object GetTemplateChild(string name) => TemplateUtilities.GetTemplateChild(this, name); - /// + /// + /// Resolves and returns the associated with this instance. + /// + /// The currently assigned to this instance. If no template is assigned, this method returns . public virtual ControlTemplate ResolveControlTemplate() { return ControlTemplate; @@ -165,7 +191,93 @@ Size ICrossPlatformLayout.CrossPlatformArrange(Rect bounds) return bounds.Size; } -#nullable disable + Size IContentView.CrossPlatformMeasure(double widthConstraint, double heightConstraint) => ((ICrossPlatformLayout)this).CrossPlatformMeasure(widthConstraint, heightConstraint); + + Size IContentView.CrossPlatformArrange(Rect bounds) => + ((ICrossPlatformLayout)this).CrossPlatformArrange(bounds); + + + + /// + /// Sends a child to the back of the visual stack. + /// + /// The view to lower in the visual stack. + /// Children are internally stored in visual stack order. + /// This means that raising or lowering a child also changes the order in which the children are enumerated. + [Obsolete("Use the ZIndex Property instead")] + public new void LowerChild(View view) + { + base.LowerChild(view); + } + + /// + /// Sends a child to the front of the visual stack. + /// + /// The view to raise in the visual stack. + /// Children are internally stored in visual stack order. + /// This means that raising or lowering a child also changes the order in which the children are enumerated. + [Obsolete("Use the ZIndex Property instead")] + public new void RaiseChild(View view) + { + base.RaiseChild(view); + } + + /// + /// Invalidates the current layout. + /// + /// Calling this method will invalidate the measure and triggers a new layout cycle. + [Obsolete("Use InvalidateMeasure depending on your scenario")] + protected override void InvalidateLayout() + { + base.InvalidateLayout(); + } + + /// + /// Invoked whenever a child of the layout has emitted . + /// Implement this method to add class handling for this event. + /// + [Obsolete("Subscribe to the MeasureInvalidated Event on the Children.")] + protected override void OnChildMeasureInvalidated() + { + } + + /// + /// If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later. + /// + /// The child for which to specify whether or not to track invalidation. + /// if should call , otherwise . + [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later.")] + protected override bool ShouldInvalidateOnChildAdded(View child) => true; + + /// + /// If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later. + /// + /// The child for which to specify whether or not to track invalidation. + /// if should call , otherwise . + [Obsolete("If you want to influence invalidation override InvalidateMeasureOverride. This method will no longer work on .NET 10 and later.")] + protected override bool ShouldInvalidateOnChildRemoved(View child) => true; + + /// + /// Use InvalidateMeasure depending on your scenario. This method will no longer work on .NET 10 and later. + /// + [Obsolete("Use InvalidateMeasure depending on your scenario. This method will no longer work on .NET 10 and later.")] + protected new void UpdateChildrenLayout() + { + } + + [Obsolete("Use ArrangeOverride instead")] + protected override void LayoutChildren(double x, double y, double width, double height) + { + } + + [Obsolete("Use MeasureOverride instead")] + protected override SizeRequest OnMeasure(double widthConstraint, double heightConstraint) + { + return base.OnMeasure(widthConstraint, heightConstraint); + } + [EditorBrowsable(EditorBrowsableState.Never)] + [Obsolete("Use IVisualTreeElement.GetVisualChildren() instead.", true)] + public new IReadOnlyList Children => base.Children; } } \ No newline at end of file diff --git a/src/Controls/src/Core/ViewExtensions.cs b/src/Controls/src/Core/ViewExtensions.cs index 403183402349..b5dd844e3178 100644 --- a/src/Controls/src/Core/ViewExtensions.cs +++ b/src/Controls/src/Core/ViewExtensions.cs @@ -104,6 +104,7 @@ public static Task LayoutTo(this VisualElement view, Rect bounds, uint len /// A containing a value which indicates whether the animation was canceled. /// indicates that the animation was canceled. indicates that the animation ran to completion. /// Thrown when is . + [Obsolete("Use Translation to animate layout changes.")] public static Task LayoutToAsync(this VisualElement view, Rect bounds, uint length = 250, Easing? easing = null) { if (view is null) diff --git a/src/Controls/src/Core/VisualElement/VisualElement.cs b/src/Controls/src/Core/VisualElement/VisualElement.cs index f28bd0446662..d58f9954de98 100644 --- a/src/Controls/src/Core/VisualElement/VisualElement.cs +++ b/src/Controls/src/Core/VisualElement/VisualElement.cs @@ -662,13 +662,11 @@ protected virtual bool IsEnabledCore /// /// This value represents the cumulative InputTransparent value. - /// All types that override this property need to also invoke - /// the RefreshInputTransparentProperty() method if the value will change. /// /// This method is not virtual as none of the derived types actually need /// to change the calculation. If this ever needs to change, then the - /// RefreshInputTransparentProperty() method should also call the - /// RefreshPropertyValue() method - just like how the + /// InputTransparentContainerElement.OnCascadeInputTransparentPropertyChanged + /// method should also call the RefreshPropertyValue() method - just like how the /// RefreshIsEnabledProperty() method does. /// private protected bool InputTransparentCore @@ -1741,20 +1739,6 @@ void IPropertyPropagationController.PropagatePropertyChanged(string propertyName protected void RefreshIsEnabledProperty() => this.RefreshPropertyValue(IsEnabledProperty, _isEnabledExplicit); - /// - /// This method must always be called if some event occurs and the value of - /// the InputTransparentCore property will change. - /// - private protected void RefreshInputTransparentProperty() - { - // This method does not need to call the - // this.RefreshPropertyValue(InputTransparentProperty, _inputTransparentExplicit); - // method because none of the derived types will affect this view. All we - // need to do is propagate the new value to all the children. - - (this as IPropertyPropagationController)?.PropagatePropertyChanged(VisualElement.InputTransparentProperty.PropertyName); - } - void UpdateBoundsComponents(Rect bounds) { if (_frame == bounds) @@ -1930,9 +1914,18 @@ protected virtual Size ArrangeOverride(Rect bounds) /// /// The new bounds of the element. /// Calling this method will trigger a layout cycle for the sub-tree of this element. + [Obsolete("Use ArrangeOverride instead. This method will be removed in a future version.")] public void Layout(Rect bounds) { - Bounds = bounds; + if (Handler is null) + { + Bounds = bounds; + return; + } + + // This forces any call to Layout to use the newer Arrange passes + // This should make it so legacy code that calls Layout will still work, but will use the new Measure and Arrange passes. + Arrange(bounds); } /// diff --git a/src/Controls/tests/Core.UnitTests/AppThemeTests.cs b/src/Controls/tests/Core.UnitTests/AppThemeTests.cs index 1a336be25a17..60a71adab4d6 100644 --- a/src/Controls/tests/Core.UnitTests/AppThemeTests.cs +++ b/src/Controls/tests/Core.UnitTests/AppThemeTests.cs @@ -204,10 +204,10 @@ public void ThemeBindingRemovedOnOneTimeBindablePropertyWhenPropertySet() void validateRadioButtonColors(RadioButton button, SolidColorBrush desiredBrush) { - var border = (Border)button.Children[0]; + var border = (Border)(button as IVisualTreeElement).GetVisualChildren()[0]; var grid = (Grid)border.Content; - var outerEllipse = (Ellipse)grid.Children[0]; - var innerEllipse = (Ellipse)grid.Children[1]; + var outerEllipse = (Ellipse)grid[0]; + var innerEllipse = (Ellipse)grid[1]; Assert.Equal(desiredBrush, outerEllipse.Stroke); Assert.Equal(desiredBrush, innerEllipse.Fill); diff --git a/src/Controls/tests/Core.UnitTests/BindableLayoutTests.cs b/src/Controls/tests/Core.UnitTests/BindableLayoutTests.cs index 6621947e5018..d8a3e81048dd 100644 --- a/src/Controls/tests/Core.UnitTests/BindableLayoutTests.cs +++ b/src/Controls/tests/Core.UnitTests/BindableLayoutTests.cs @@ -730,7 +730,7 @@ static bool IsLayoutWithItemsSource(IEnumerable itemsSource, Compatibility.Layou { if (itemsSource == null) { - return layout.Children.Count() == 0; + return layout.InternalChildren.Count() == 0; } int i = 0; @@ -739,14 +739,14 @@ static bool IsLayoutWithItemsSource(IEnumerable itemsSource, Compatibility.Layou if (BindableLayout.GetItemTemplate(layout) is DataTemplate dataTemplate || BindableLayout.GetItemTemplateSelector(layout) is DataTemplateSelector dataTemplateSelector) { - if (!Equals(item, layout.Children[i].BindingContext)) + if (!Equals(item, layout.InternalChildren[i].BindingContext)) { return false; } } else { - if (!Equals(item?.ToString(), ((Label)layout.Children[i]).Text)) + if (!Equals(item?.ToString(), ((Label)layout.InternalChildren[i]).Text)) { return false; } @@ -755,7 +755,7 @@ static bool IsLayoutWithItemsSource(IEnumerable itemsSource, Compatibility.Layou ++i; } - return layout.Children.Count == i; + return layout.InternalChildren.Count == i; } class DataTemplateBoxView : DataTemplate diff --git a/src/Controls/tests/Core.UnitTests/CarouselPageTests.cs b/src/Controls/tests/Core.UnitTests/CarouselPageTests.cs deleted file mode 100644 index 1f308301be6e..000000000000 --- a/src/Controls/tests/Core.UnitTests/CarouselPageTests.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Xunit; - -namespace Microsoft.Maui.Controls.Core.UnitTests -{ - public class CarouselPageTests : MultiPageTests - { - protected override MultiPage CreateMultiPage() - { - return new CarouselPage(); - } - - protected override ContentPage CreateContainedPage() - { - return new ContentPage { Content = new View() }; - } - - protected override int GetIndex(ContentPage page) - { - return CarouselPage.GetIndex(page); - } - - [Fact] - public void TestConstructor() - { - var page = new CarouselPage(); - Assert.Empty(page.Children); - } - } -} diff --git a/src/Controls/tests/Core.UnitTests/ContentFormUnitTests.cs b/src/Controls/tests/Core.UnitTests/ContentFormUnitTests.cs index 3a43337818a7..e57edad4bc04 100644 --- a/src/Controls/tests/Core.UnitTests/ContentFormUnitTests.cs +++ b/src/Controls/tests/Core.UnitTests/ContentFormUnitTests.cs @@ -70,10 +70,11 @@ public void PropagateToolbarItemBindingContextPostAdd() public void ContentPage_should_have_the_InternalChildren_correctly_when_Content_changed() { var sut = new ContentPage(); - IList internalChildren = ((IControlTemplated)sut).InternalChildren; - internalChildren.Add(new VisualElement()); - internalChildren.Add(new VisualElement()); - internalChildren.Add(new VisualElement()); + var controlTemplated = (IControlTemplated)sut; + var internalChildren = controlTemplated.InternalChildren; + controlTemplated.AddLogicalChild(new VisualElement()); + controlTemplated.AddLogicalChild(new VisualElement()); + controlTemplated.AddLogicalChild(new VisualElement()); var expected = new View(); sut.Content = expected; diff --git a/src/Controls/tests/Core.UnitTests/ContentViewUnitTest.cs b/src/Controls/tests/Core.UnitTests/ContentViewUnitTest.cs index 7f9ff7e5472f..a054ce8c6c12 100644 --- a/src/Controls/tests/Core.UnitTests/ContentViewUnitTest.cs +++ b/src/Controls/tests/Core.UnitTests/ContentViewUnitTest.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Maui.Graphics; +using NSubstitute; using Xunit; namespace Microsoft.Maui.Controls.Core.UnitTests @@ -73,6 +74,17 @@ public void TestReplaceChild() public void TestFrameLayout() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size (100x200) + return new Size(100, 200); + }); var contentView = new ContentView { @@ -81,22 +93,46 @@ public void TestFrameLayout() { WidthRequest = 100, HeightRequest = 200, - IsPlatformEnabled = true + IsPlatformEnabled = true, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - Assert.Equal(new Size(120, 220), contentView.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.None).Request); + ICrossPlatformLayout crossPlatformLayout = contentView; + + // Test that the measure includes padding + Assert.Equal(new Size(120, 220), crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity)); + + // Lay out the content view + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 300, 300)); - contentView.Layout(new Rect(0, 0, 300, 300)); + // Verify child was positioned with padding respected + Assert.Equal(new Rect(100, 50, 100, 200), child.Bounds); - Assert.Equal(new Rect(10, 10, 280, 280), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(Arg.Is(r => + Math.Abs(r.X - 100) < 0.001 && + Math.Abs(r.Y - 50) < 0.001 && + Math.Abs(r.Width - 100) < 0.001 && + Math.Abs(r.Height - 200) < 0.001)); } [Fact] public void WidthRequest() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 200); + }); var contentView = new ContentView { @@ -105,19 +141,36 @@ public void WidthRequest() { WidthRequest = 100, HeightRequest = 200, - IsPlatformEnabled = true + IsPlatformEnabled = true, + Handler = mockViewHandler }, IsPlatformEnabled = true, WidthRequest = 20 }; - Assert.Equal(new Size(40, 220), contentView.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.None).Request); + // Get the ICrossPlatformLayout implementation + ICrossPlatformLayout crossPlatformLayout = contentView; + + // Test that the measure includes padding and respects the contentView's WidthRequest + var result = crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity); + Assert.Equal(new Size(120, 220), result); } [Fact] public void HeightRequest() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 200); + }); var contentView = new ContentView { @@ -127,18 +180,35 @@ public void HeightRequest() WidthRequest = 100, HeightRequest = 200, IsPlatformEnabled = true, + Handler = mockViewHandler }, IsPlatformEnabled = true, HeightRequest = 20 }; - Assert.Equal(new Size(120, 40), contentView.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.None).Request); + // Get the ICrossPlatformLayout implementation + ICrossPlatformLayout crossPlatformLayout = contentView; + + // Test that the measure includes padding and respects the contentView's HeightRequest + var result = crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity); + Assert.Equal(new Size(120, 220), result); } [Fact] public void LayoutVerticallyCenter() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var contentView = new ContentView { @@ -147,20 +217,41 @@ public void LayoutVerticallyCenter() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - VerticalOptions = LayoutOptions.Center + VerticalOptions = LayoutOptions.Center, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - contentView.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = contentView; + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); + + // Verify child bounds based on the updated layout implementation + Assert.Equal(new Rect(100, 100, 0, 0), child.Bounds); - Assert.Equal(new Rect(0, 50, 200, 100), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(Arg.Is(r => + Math.Abs(r.X - 100) < 0.001 && + Math.Abs(r.Y - 100) < 0.001 && + Math.Abs(r.Width - 0) < 0.001 && + Math.Abs(r.Height - 0) < 0.001)); } [Fact] public void LayoutVerticallyBegin() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var contentView = new ContentView { @@ -169,20 +260,41 @@ public void LayoutVerticallyBegin() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - VerticalOptions = LayoutOptions.Start + VerticalOptions = LayoutOptions.Start, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - contentView.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = contentView; + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); - Assert.Equal(new Rect(0, 0, 200, 100), child.Bounds); + // Verify child bounds based on the updated layout implementation + Assert.Equal(new Rect(100, 0, 0, 0), child.Bounds); + + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(Arg.Is(r => + Math.Abs(r.X - 100) < 0.001 && + Math.Abs(r.Y - 0) < 0.001 && + Math.Abs(r.Width - 0) < 0.001 && + Math.Abs(r.Height - 0) < 0.001)); } [Fact] public void LayoutVerticallyEnd() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var contentView = new ContentView { @@ -191,20 +303,41 @@ public void LayoutVerticallyEnd() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - VerticalOptions = LayoutOptions.End + VerticalOptions = LayoutOptions.End, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - contentView.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = contentView; + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); + + // Verify child bounds based on the updated layout implementation + Assert.Equal(new Rect(100, 200, 0, 0), child.Bounds); - Assert.Equal(new Rect(0, 100, 200, 100), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(Arg.Is(r => + Math.Abs(r.X - 100) < 0.001 && + Math.Abs(r.Y - 200) < 0.001 && + Math.Abs(r.Width - 0) < 0.001 && + Math.Abs(r.Height - 0) < 0.001)); } [Fact] public void LayoutHorizontallyCenter() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var contentView = new ContentView { @@ -213,20 +346,41 @@ public void LayoutHorizontallyCenter() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - HorizontalOptions = LayoutOptions.Center + HorizontalOptions = LayoutOptions.Center, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - contentView.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = contentView; + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); + + // Verify child bounds based on the updated layout implementation + Assert.Equal(new Rect(100, 100, 0, 0), child.Bounds); - Assert.Equal(new Rect(50, 0, 100, 200), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(Arg.Is(r => + Math.Abs(r.X - 100) < 0.001 && + Math.Abs(r.Y - 100) < 0.001 && + Math.Abs(r.Width - 0) < 0.001 && + Math.Abs(r.Height - 0) < 0.001)); } [Fact] public void LayoutHorizontallyBegin() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var contentView = new ContentView { @@ -235,20 +389,41 @@ public void LayoutHorizontallyBegin() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - HorizontalOptions = LayoutOptions.Start + HorizontalOptions = LayoutOptions.Start, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - contentView.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = contentView; + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); - Assert.Equal(new Rect(0, 0, 100, 200), child.Bounds); + // Verify child bounds based on the updated layout implementation + Assert.Equal(new Rect(0, 100, 0, 0), child.Bounds); + + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(Arg.Is(r => + Math.Abs(r.X - 0) < 0.001 && + Math.Abs(r.Y - 100) < 0.001 && + Math.Abs(r.Width - 0) < 0.001 && + Math.Abs(r.Height - 0) < 0.001)); } [Fact] public void LayoutHorizontallyEnd() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var contentView = new ContentView { @@ -257,14 +432,24 @@ public void LayoutHorizontallyEnd() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - HorizontalOptions = LayoutOptions.End + HorizontalOptions = LayoutOptions.End, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - contentView.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = contentView; + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); + + // Verify child was positioned at the right + Assert.Equal(new Rect(200, 100, 0, 0), child.Bounds); - Assert.Equal(new Rect(100, 0, 100, 200), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(Arg.Is(r => + Math.Abs(r.X - 200) < 0.001 && + Math.Abs(r.Y - 100) < 0.001 && + Math.Abs(r.Width - 0) < 0.001 && + Math.Abs(r.Height - 0) < 0.001)); } [Fact] @@ -403,10 +588,11 @@ public void NonTemplatedContentInheritsBindingContext() public void ContentView_should_have_the_InternalChildren_correctly_when_Content_changed() { var sut = new ContentView(); - IList internalChildren = ((IControlTemplated)sut).InternalChildren; - internalChildren.Add(new VisualElement()); - internalChildren.Add(new VisualElement()); - internalChildren.Add(new VisualElement()); + var controlTemplated = (IControlTemplated)sut; + var internalChildren = controlTemplated.InternalChildren; + controlTemplated.AddLogicalChild(new VisualElement()); + controlTemplated.AddLogicalChild(new VisualElement()); + controlTemplated.AddLogicalChild(new VisualElement()); var expected = new View(); sut.Content = expected; diff --git a/src/Controls/tests/Core.UnitTests/FlyoutPageUnitTests.cs b/src/Controls/tests/Core.UnitTests/FlyoutPageUnitTests.cs index f8deee064de9..e9776de3aeb1 100644 --- a/src/Controls/tests/Core.UnitTests/FlyoutPageUnitTests.cs +++ b/src/Controls/tests/Core.UnitTests/FlyoutPageUnitTests.cs @@ -168,80 +168,6 @@ public void TestFlyoutVisibleDoubleSet() Assert.False(signaled); } - [Fact] - public void TestSetFlyoutBounds() - { - var page = new FlyoutPage - { - Flyout = new ContentPage { Content = new View(), Title = "Foo" }, - Detail = new ContentPage { Content = new View() } - }; - - ((IFlyoutPageController)page).FlyoutBounds = new Rect(0, 0, 100, 100); - Assert.Equal(new Rect(0, 0, 100, 100), page.Flyout.Bounds); - Assert.Equal(new Rect(0, 0, 100, 100), ((IFlyoutPageController)page).FlyoutBounds); - } - - [Fact] - public void TestSetDetailBounds() - { - var page = new FlyoutPage - { - Flyout = new ContentPage { Content = new View(), Title = "Foo" }, - Detail = new ContentPage { Content = new View() } - }; - - ((IFlyoutPageController)page).DetailBounds = new Rect(0, 0, 100, 100); - Assert.Equal(new Rect(0, 0, 100, 100), page.Detail.Bounds); - Assert.Equal(new Rect(0, 0, 100, 100), ((IFlyoutPageController)page).DetailBounds); - } - - [Fact] - public void TestLayoutChildren() - { - var page = new FlyoutPage - { - Flyout = new ContentPage { Content = new View(), IsPlatformEnabled = true, Title = "Foo" }, - Detail = new ContentPage { Content = new View(), IsPlatformEnabled = true }, - IsPlatformEnabled = true, - }; - - ((IFlyoutPageController)page).FlyoutBounds = new Rect(0, 0, 100, 200); - ((IFlyoutPageController)page).DetailBounds = new Rect(0, 0, 100, 100); - - page.Flyout.Layout(new Rect(0, 0, 1, 1)); - page.Detail.Layout(new Rect(0, 0, 1, 1)); - - page.Layout(new Rect(0, 0, 200, 200)); - - Assert.Equal(new Rect(0, 0, 100, 200), page.Flyout.Bounds); - Assert.Equal(new Rect(0, 0, 100, 100), page.Detail.Bounds); - } - - [Fact] - public void ThorwsInLayoutChildrenWithNullDetail() - { - var page = new FlyoutPage - { - Flyout = new ContentPage { Content = new View(), IsPlatformEnabled = true, Title = "Foo" }, - IsPlatformEnabled = true, - }; - - Assert.Throws(() => page.Layout(new Rect(0, 0, 200, 200))); - } - - [Fact] - public void ThorwsInLayoutChildrenWithNullFlyout() - { - var page = new FlyoutPage - { - Detail = new ContentPage { Content = new View(), IsPlatformEnabled = true }, - IsPlatformEnabled = true, - }; - - Assert.Throws(() => page.Layout(new Rect(0, 0, 200, 200))); - } - [Fact] public void ThorwsInSetDetailBoundsWithNullDetail() { diff --git a/src/Controls/tests/Core.UnitTests/FrameUnitTests.cs b/src/Controls/tests/Core.UnitTests/FrameUnitTests.cs index f620861ebcb6..321ee67ee540 100644 --- a/src/Controls/tests/Core.UnitTests/FrameUnitTests.cs +++ b/src/Controls/tests/Core.UnitTests/FrameUnitTests.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Maui.Graphics; +using NSubstitute; using Xunit; namespace Microsoft.Maui.Controls.Core.UnitTests @@ -69,6 +70,18 @@ public void TestReplaceChild() public void TestFrameLayout() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => + { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 200); + }); var frame = new Frame { @@ -76,16 +89,22 @@ public void TestFrameLayout() { WidthRequest = 100, HeightRequest = 200, - IsPlatformEnabled = true + IsPlatformEnabled = true, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - Assert.Equal(new Size(140, 240), frame.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.None).Request); + ICrossPlatformLayout crossPlatformLayout = frame; + + Assert.Equal(new Size(140, 240), crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity)); + + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 300, 300)); - frame.Layout(new Rect(0, 0, 300, 300)); + Assert.Equal(new Rect(100, 50, 100, 200), child.Bounds); - Assert.Equal(new Rect(20, 20, 260, 260), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(new Rect(100, 50, 100, 200)); } [Fact] @@ -97,43 +116,91 @@ public void TestDoesNotThrowOnSetNullChild() [Fact] public void WidthRequest() { + View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => + { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 200); + }); + var frame = new Frame { - Content = new View + Content = child = new View { WidthRequest = 100, HeightRequest = 200, - IsPlatformEnabled = true + IsPlatformEnabled = true, + Handler = mockViewHandler }, IsPlatformEnabled = true, WidthRequest = 20 }; - Assert.Equal(new Size(60, 240), frame.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.None).Request); + // Get the ICrossPlatformLayout implementation + ICrossPlatformLayout crossPlatformLayout = frame; + + Assert.Equal(new Size(140, 240), crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity)); } [Fact] public void HeightRequest() { + View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => + { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 200); + }); + var frame = new Frame { - Content = new View + Content = child = new View { WidthRequest = 100, HeightRequest = 200, IsPlatformEnabled = true, + Handler = mockViewHandler }, IsPlatformEnabled = true, HeightRequest = 20 }; - Assert.Equal(new Size(140, 60), frame.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.None).Request); + // Get the ICrossPlatformLayout implementation + ICrossPlatformLayout crossPlatformLayout = frame; + + Assert.Equal(new Size(140, 240), crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity)); } [Fact] public void LayoutVerticallyCenter() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => + { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var frame = new Frame { @@ -142,20 +209,38 @@ public void LayoutVerticallyCenter() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - VerticalOptions = LayoutOptions.Center + VerticalOptions = LayoutOptions.Center, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - frame.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = frame; + crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity); + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); + + Assert.Equal(new Rect(50, 50, 100, 100), child.Bounds); - Assert.Equal(new Rect(20, 50, 160, 100), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(new Rect(50, 50, 100, 100)); } [Fact] public void LayoutVerticallyBegin() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => + { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var frame = new Frame { @@ -164,20 +249,38 @@ public void LayoutVerticallyBegin() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - VerticalOptions = LayoutOptions.Start + VerticalOptions = LayoutOptions.Start, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - frame.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = frame; + crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity); + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); + + Assert.Equal(new Rect(50, 20, 100, 100), child.Bounds); - Assert.Equal(new Rect(20, 20, 160, 100), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(new Rect(50, 20, 100, 100)); } [Fact] public void LayoutVerticallyEnd() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => + { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var frame = new Frame { @@ -186,20 +289,38 @@ public void LayoutVerticallyEnd() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - VerticalOptions = LayoutOptions.End + VerticalOptions = LayoutOptions.End, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - frame.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = frame; + crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity); + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); - Assert.Equal(new Rect(20, 80, 160, 100), child.Bounds); + Assert.Equal(new Rect(50, 80, 100, 100), child.Bounds); + + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(new Rect(50, 80, 100, 100)); } [Fact] public void LayoutHorizontallyCenter() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => + { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var frame = new Frame { @@ -208,20 +329,38 @@ public void LayoutHorizontallyCenter() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - HorizontalOptions = LayoutOptions.Center + HorizontalOptions = LayoutOptions.Center, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - frame.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = frame; + crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity); + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); + + Assert.Equal(new Rect(50, 50, 100, 100), child.Bounds); - Assert.Equal(new Rect(50, 20, 100, 160), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(new Rect(50, 50, 100, 100)); } [Fact] public void LayoutHorizontallyBegin() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => + { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var frame = new Frame { @@ -230,20 +369,38 @@ public void LayoutHorizontallyBegin() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - HorizontalOptions = LayoutOptions.Start + HorizontalOptions = LayoutOptions.Start, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - frame.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = frame; + crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity); + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); - Assert.Equal(new Rect(20, 20, 100, 160), child.Bounds); + Assert.Equal(new Rect(20, 50, 100, 100), child.Bounds); + + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(new Rect(20, 50, 100, 100)); } [Fact] public void LayoutHorizontallyEnd() { View child; + var mockViewHandler = Substitute.For(); + + // Set up the mock handler to properly participate in the layout system + mockViewHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => + { + // Extract the constraints passed to GetDesiredSize + var width = (double)callInfo[0]; + var height = (double)callInfo[1]; + + // Return the child's requested size + return new Size(100, 100); + }); var frame = new Frame { @@ -252,14 +409,20 @@ public void LayoutHorizontallyEnd() WidthRequest = 100, HeightRequest = 100, IsPlatformEnabled = true, - HorizontalOptions = LayoutOptions.End + HorizontalOptions = LayoutOptions.End, + Handler = mockViewHandler }, IsPlatformEnabled = true, }; - frame.Layout(new Rect(0, 0, 200, 200)); + ICrossPlatformLayout crossPlatformLayout = frame; + crossPlatformLayout.CrossPlatformMeasure(double.PositiveInfinity, double.PositiveInfinity); + crossPlatformLayout.CrossPlatformArrange(new Rect(0, 0, 200, 200)); + + Assert.Equal(new Rect(80, 50, 100, 100), child.Bounds); - Assert.Equal(new Rect(80, 20, 100, 160), child.Bounds); + // Verify the PlatformArrange method was called on the handler with the correct frame + mockViewHandler.Received().PlatformArrange(new Rect(80, 50, 100, 100)); } [Fact] diff --git a/src/Controls/tests/Core.UnitTests/MarginTests.cs b/src/Controls/tests/Core.UnitTests/MarginTests.cs index 37caddc760c2..782117eee95b 100644 --- a/src/Controls/tests/Core.UnitTests/MarginTests.cs +++ b/src/Controls/tests/Core.UnitTests/MarginTests.cs @@ -5,8 +5,6 @@ namespace Microsoft.Maui.Controls.Core.UnitTests { - using StackLayout = Microsoft.Maui.Controls.Compatibility.StackLayout; - public class MarginTests : BaseTestFixture { [Fact] @@ -16,13 +14,17 @@ public void GetSizeRequestIncludesMargins() { IsPlatformEnabled = true, }; + + var mockHandler = Substitute.For(); + mockHandler.GetDesiredSize(Arg.Any(), Arg.Any()).Returns(callInfo => new Size(100, 50)); var child = MockPlatformSizeService.Sub