private void ConnectMasterViewModel(ITabbedNavigationControllerViewModel viewModel) { _viewModel = viewModel; BarBackgroundColor = viewModel.NavigationBarColour; BarTextColor = viewModel.NavigationBarTextColour; this.SetBinding(BarBackgroundColorProperty, "NavigationBarColour"); this.SetBinding(BarTextColorProperty, "NavigationBarTextColour"); _viewModel.Pages.ForEach(p => { var page = _viewFactory.CreatePage(p); _pageMap.Add(page, p); Children.Add(page); }); CurrentPage = Children[0]; //if (_viewModel.CurrentPage == null) throw new NotSupportedException("You must specify a current page for the master navigation controller."); }
private void DisconnectCurrentModel() { _viewModel = null; }