예제 #1
0
        void UpdateContent()
        {
            _ = 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.");

            // Cleanup the old view when reused
            NativeView.ClearSubviews();

            if (VirtualView.PresentedContent is IView view)
            {
                NativeView.AddSubview(view.ToNative(MauiContext));
            }
        }