Exemplo n.º 1
0
        public override void SetVirtualView(IView view)
        {
            base.SetVirtualView(view);

            _ = NativeView ?? throw new InvalidOperationException($"{nameof(NativeView)} should have been set by base class.");
            _ = VirtualView ?? throw new InvalidOperationException($"{nameof(VirtualView)} should have been set by base class.");
            _ = MauiContext ?? throw new InvalidOperationException($"{nameof(MauiContext)} should have been set by base class.");

            NativeView.View = view;
            NativeView.CrossPlatformMeasure = VirtualView.CrossPlatformMeasure;
            NativeView.CrossPlatformArrange = VirtualView.CrossPlatformArrange;

            // Remove any previous children
            NativeView.ClearSubviews();

            foreach (var child in VirtualView)
            {
                NativeView.AddSubview(child.ToNative(MauiContext));
            }
        }
Exemplo n.º 2
0
 public void Clear()
 {
     NativeView.ClearSubviews();
 }
Exemplo n.º 3
0
 public void Clear()
 {
     PlatformView.ClearSubviews();
 }