private IEnumerable<NavigationButtonInfoMeta> getPrimaryButtons(ViewModelBaseExt viewModel) { //if (string.IsNullOrEmpty(PrimaryNavigationEntryPath)) //{ // //need to break it down //adding them twice and setting page shouldnt change primary buttons (extra gets dropped, just pass empty - no, smoehting? and handle) //null for no change, 0 for 0 //windows UAP cache //} if (viewModel is ShellViewModelExt) return null; if (viewModel is SettingsPageViewModelExt) return null; IEnumerable<NavigationButtonInfoMeta> buttons = new NavigationButtonInfoMeta[] { new NavigationButtonInfoMeta() { PageType = Type.GetType("Minimal.Views.HomePage"), PageParameter = "Source=Shell", Text = "Home", Symbol = Symbol.Home }, new NavigationButtonInfoMeta() { PageType = Type.GetType("Minimal.Views.MasterPage"), PageParameter = "Source=Shell", Text = "Master", Symbol = Symbol.ImportAll } }; if (viewModel is DetailPageViewModelExt) buttons = buttons.Union(new NavigationButtonInfoMeta[] { new NavigationButtonInfoMeta() { PageType = Type.GetType("Minimal.Views.DetailPage"), PageParameter = "Source=Shell", Text = "Detail Page", Symbol = Symbol.AddFriend } }); return buttons; }
private IEnumerable<NavigationButtonInfoMeta> getSecondaryButtons(ViewModelBaseExt viewModel) { //if ((viewModel is ShellViewModelExt) == false) // return null; if (viewModel is ShellViewModelExt) return null; return new NavigationButtonInfoMeta[] { new NavigationButtonInfoMeta() { PageType = Type.GetType("Minimal.Views.SettingsPageExt"), PageParameter = "Source=Shell", Text = "Settings", Symbol = Symbol.Setting } }; }
internal void OnViewnNavigatedTo(ViewModelBaseExt viewModel) { //manage page specific nav buttons syncNavButtons(getPrimaryButtons(viewModel), this.PrimaryButtons); syncNavButtons(getSecondaryButtons(viewModel), this.SecondaryButtons); return; }