public IVisualElementRenderer Convert(Xamarin.Forms.View source, Xamarin.Forms.VisualElement valid) { IVisualElementRenderer render = (IVisualElementRenderer)source.GetValue(RendererProperty); if (render == null) { render = Platform.CreateRenderer(source); source.SetValue(RendererProperty, render); var p = PlatformProperty.GetValue(valid); PlatformProperty.SetValue(source, p); IsPlatformEnabledProperty.SetValue(source, true); } return(render); }
public IVisualElementRenderer Convert(Xamarin.Forms.View source, Xamarin.Forms.VisualElement valid) { //only wp allow us to get renderer directly IVisualElementRenderer render = source.GetRenderer(); if (render == null) { render = RendererFactory.GetRenderer(source); source.SetRenderer(render); if (valid != null) { var p = PlatformProperty.GetValue(valid); if (p != null) { PlatformProperty.SetValue(source, p); IsPlatformEnabledProperty.SetValue(source, true); } } } return(render); }