PageRenderer.OnModelSet is gone from 1.2.x

MarkRadacz.7953MarkRadacz.7953 USInsider, University, Developer Group Leader ✭✭

Need to bring native pages to XF.. need to override PageRenderer.OnModelSet just like in

`
// This ExportRenderer command tells Xamarin.Forms to use this renderer
// instead of the built-in one for this page
[assembly:ExportRenderer(typeof(Forms2Native.MyThirdPage), typeof(Forms2Native.MyThirdPageRenderer))]

namespace Forms2Native
{
///


/// Render this page using platform-specific UIKit controls
///

public class MyThirdPageRenderer : PageRenderer
{
protected override void OnModelSet (Xamarin.Forms.VisualElement model)
{
base.OnModelSet (model);

        var page = model as MyThirdPage;

        var hostViewController = ViewController;

        var viewController = new UIViewController ();

`

complete example at
https://github.com/xamarin/xamarin-forms-samples/tree/master/Forms2Native

this example does no longer compile with XF 1.2.x

any help would be appreciated..

tnx

Posts

  • MarkRadacz.7953MarkRadacz.7953 USInsider, University, Developer Group Leader ✭✭

    got it working.. use OnElementChanged instead of OnModelSet in the PageRenderer and works fine..

Sign In or Register to comment.