/**
         * Prepares the view instance when intialized. When subclassing,
         * it is recommended to override the prepareView method
         * to initialize property values and other setup operations.
         * The super.prepareView method should always be called immediately
         * when subclassing.
         */
        public virtual void Prepare()
        {
            NavigationBar.SetHeightPreset(HeightPreset.Normal);
            NavigationBar.SetWidth(View.Width());

            View.ClipsToBounds      = true;
            View.BackgroundColor    = Color.White;
            View.ContentScaleFactor = Device.Scale;

            // This ensures the panning gesture is available when going back between views.
            var v = InteractivePopGestureRecognizer;

            if (v != null)
            {
                v.Enabled  = true;
                v.Delegate = this;
            }
        }
 public override void ViewWillLayoutSubviews()
 {
     base.ViewWillLayoutSubviews();
     NavigationBar.SetNeedsLayout();
     NavigationBar.LayoutIfNeeded();
 }