示例#1
0
 public static void MapContent(IBorderHandler handler, IBorderView border)
 {
     if (handler is BorderHandler borderHandler)
     {
         borderHandler.UpdateContent();
     }
 }
示例#2
0
        static void UpdateContent(IBorderHandler handler)
        {
            _ = handler.PlatformView ?? throw new InvalidOperationException($"{nameof(PlatformView)} should have been set by base class.");
            _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");
            _ = handler.VirtualView ?? throw new InvalidOperationException($"{nameof(VirtualView)} should have been set by base class.");

            handler.PlatformView.RemoveAllViews();

            if (handler.VirtualView.PresentedContent is IView view)
            {
                handler.PlatformView.AddView(view.ToPlatform(handler.MauiContext));
            }
        }
示例#3
0
        static void UpdateContent(IBorderHandler handler)
        {
            _ = handler.PlatformView ?? throw new InvalidOperationException($"{nameof(PlatformView)} should have been set by base class.");
            _ = handler.VirtualView ?? throw new InvalidOperationException($"{nameof(VirtualView)} should have been set by base class.");
            _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");

            handler.PlatformView.Children.Clear();
            handler.PlatformView.EnsureBorderPath();

            if (handler.VirtualView.PresentedContent is IView view)
            {
                handler.PlatformView.Content = view.ToPlatform(handler.MauiContext);
            }
        }
示例#4
0
        static void UpdateContent(IBorderHandler handler)
        {
            _ = handler.PlatformView ?? throw new InvalidOperationException($"{nameof(PlatformView)} should have been set by base class.");
            _ = handler.VirtualView ?? throw new InvalidOperationException($"{nameof(VirtualView)} should have been set by base class.");
            _ = handler.MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");

            //Cleanup the old view when reused
            var oldChildren = handler.PlatformView.Subviews.ToList();

            oldChildren.ForEach(x => x.RemoveFromSuperview());

            if (handler.VirtualView.PresentedContent is IView view)
            {
                handler.PlatformView.AddSubview(view.ToPlatform(handler.MauiContext));
            }
        }
示例#5
0
 public static void MapContent(IBorderHandler handler, IBorderView border)
 {
 }
示例#6
0
 public static void MapWidth(IBorderHandler handler, IBorderView border)
 {
     handler.PlatformView?.UpdateWidth(border);
     handler.PlatformView?.InvalidateBorderStrokeBounds();
 }