//public void Settings_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args) //{ // SettingsCommand about = new SettingsCommand("About", "About", (x) => // { // MainPage.ShowPopup(new Utilities.Settings.About(), this.ActualHeight, "About"); // }); // SettingsCommand feedback = new SettingsCommand("Feedback", "Report a bug", (x) => // { // (Application.Current as App).Feedback(); // }); // args.Request.ApplicationCommands.Add(about); // args.Request.ApplicationCommands.Add(feedback); //} private void AppsGridView_ItemClick(object sender, ItemClickEventArgs e) { Utilities.MainPageItem item = e.ClickedItem as Utilities.MainPageItem; //Navigate to the page, keeping the navigation context Utilities.App.NavigateToPage(item.App); }
/// <summary> /// Invoked to when search suggestions are requested /// </summary> /// //TBD: //public static void searchPane_SuggestionsRequested(SearchPane sender, SearchPaneSuggestionsRequestedEventArgs args) //{ // // try to see if the user entered in something valid // try // { // // Calculator serach // string calcReturn = Calculator.Calc_MainPage.searchPane_SuggestionsRequested(args.QueryText); // if (calcReturn != string.Empty) // args.Request.SearchSuggestionCollection.AppendQuerySuggestion("Answer: " + calcReturn); // // TODO : Notepad // // TODO : TODO // } // catch { } //} #endregion private void AppsGridView_ItemClick(object sender, ItemClickEventArgs e) { MainPageItem item = e.ClickedItem as MainPageItem; //Navigate to the page, keeping the navigation context App.NavigateToPage(item.App, this.CurrentNavigationState); //Reset the navigation state in case the user navigates back during a Search if (CurrentNavigationState == App.NavigationStates.Search) { this.SetNavigationState(App.NavigationStates.Normal); } }
private void InitializeGridView(App.NavigationStates state) { MainScape.Clear(); MainScape.Configure(AppsGridView_ItemClick, this.Resources["AppTileStyle"] as Style, this.Resources["AppTileTemplate"] as DataTemplate, AppsGridView_ItemClick, this.Resources["AppTileStyleSnapped"] as Style, this.Resources["AppTileTemplateSnapped"] as DataTemplate, LandscapeRow.ActualHeight, true); switch (state) { case App.NavigationStates.Normal: MainPageItem i = new MainPageItem(App.Apps.Notepad); MainScape.AddItem(i); i = new MainPageItem(App.Apps.Calculator); MainScape.AddItem(i); i = new MainPageItem(App.Apps.UnitConverter); MainScape.AddItem(i); i = new MainPageItem(App.Apps.PCalendar); MainScape.AddItem(i); i = new MainPageItem(App.Apps.NoPage); MainScape.AddItem(i); break; case App.NavigationStates.Search: //Any app which implements Search should appear here MainPageItem calc = new MainPageItem(App.Apps.Calculator); MainScape.AddItem(calc); break; case App.NavigationStates.Share: //Any app which implements Share should appear here MainPageItem notepad = new MainPageItem(App.Apps.Notepad); MainScape.AddItem(notepad); break; default: break; } }