Exemple #1
0
        void OnElementChanged(object sender, VisualElementChangedEventArgs e)
        {
            if (e.OldElement is IView view)
            {
                view.Handler = null;
            }

            if (e.NewElement is IView newView)
            {
                newView.Handler = this;
                this.SetVirtualView(newView);
            }
            else if (e.NewElement != null)
            {
                throw new Exception($"{e.NewElement} must implement: {nameof(Microsoft.Maui.IView)}");
            }
        }
Exemple #2
0
 void RendererOnElementChanged(object sender, VisualElementChangedEventArgs args)
 {
     SetElement(args.OldElement, args.NewElement);
 }
Exemple #3
0
 void OnElementChanged(object sender, VisualElementChangedEventArgs e)
 => SetElement(e.OldElement, e.NewElement);