コード例 #1
0
 internal void UpdateView(object view, DataTemplate viewTemplate, ref UIView uiView, ref VisualElement formsElement)
 {
     // Is view set on the ItemsView?
     if (view == null)
     {
         // Clear the cached Forms and native views
         uiView       = null;
         formsElement = null;
     }
     else
     {
         // Create the native renderer for the view, and keep the actual Forms element (if any)
         // around for updating the layout later
         var(NativeView, FormsElement) = TemplateHelpers.RealizeView(view, viewTemplate, ItemsView);
         uiView       = NativeView;
         formsElement = FormsElement;
     }
 }
コード例 #2
0
ファイル: ItemsViewController.cs プロジェクト: mmitche/maui
        internal void UpdateView(object view, DataTemplate viewTemplate, ref UIView uiView, ref VisualElement formsElement)
        {
            // Is view set on the ItemsView?
            if (view == null)
            {
                if (formsElement != null)
                {
                    Platform.GetRenderer(formsElement)?.DisposeRendererAndChildren();
                }

                uiView?.Dispose();
                uiView = null;

                formsElement = null;
            }
            else
            {
                // Create the native renderer for the view, and keep the actual Forms element (if any)
                // around for updating the layout later
                (uiView, formsElement) = TemplateHelpers.RealizeView(view, viewTemplate, ItemsView);
            }
        }