public override void ViewDidLoad() { base.ViewDidLoad(); AddChildViewController(_contentView); Content.AddSubview(_contentView.View); _contentView.View.Frame = Content.Frame; if (CurrentNavigationPage != null) { CurrentNavigationPage.Pushed += Container_Pushed; CurrentNavigationPage.Popped += Container_Pushed; SetNavigationBarState(); } }
// This will attatch the inner content to this container public override void ViewDidLoad() { base.ViewDidLoad(); AddChildViewController(contentViewController); Content.AddSubview(contentViewController.View); contentViewController.View.Frame = Content.Frame; if (mainNavigationPage != null) { mainNavigationPage.Pushed += (object sender, NavigationEventArgs e) => SetNavigationBarState(); mainNavigationPage.Popped += (object sender, NavigationEventArgs e) => SetNavigationBarState(); SetNavigationBarState(); } }
public override void LayoutSubviews() { double padding = 20; double x = padding; double y = padding; double w = Width - (2 * padding); double h = Height - (2 * padding); AddSubview(Content, x, y, w, h); x = 0; y = 0; Content.AddSubview(webView, x, y, w, h); }
public override void ViewDidLoad() { base.ViewDidLoad(); if (_contentView?.View is null) { throw new Exception("no view"); } AddChildViewController(_contentView); Content.AddSubview(_contentView.View); _contentView.View.Frame = Content.Frame; if (CurrentNavigationPage is { } page) { page.Pushed += Container_Pushed; page.Popped += Container_Pushed; SetNavigationBarState(); } }