protected internal override void NativeInit() { if (this.ViewController == null) { this.ViewController = new AppercodePageViewController(); WeakReference wr = new WeakReference(this); this.ViewController.Appeared += (sender, e) => { if (wr.IsAlive) { ((AppercodePage)wr.Target).Appeared(this, EventArgs.Empty); } }; ((AppercodeUIScrollView)this.ScrollView).ContentInsetsChanged += delegate(object sender, EventArgs e) { if (wr.IsAlive && AppercodeVisualRoot.Instance.Child == wr.Target) { AppercodeVisualRoot.Instance.Arrange(AppercodeVisualRoot.Instance.CurrentRect); } }; this.ViewController.View = this.ScrollView; this.ViewController.View.BackgroundColor = UIColor.White; this.NativeUIElement = this.ViewController.View; this.UpdatePageTopBarCommands(this.TopAppBar); } if (this.Title != null) { this.ViewController.Title = this.Title; } base.NativeInit(); }