private void SearchResultItemGrid_Tap(object sender, System.Windows.Input.GestureEventArgs e) { var grid = sender as Grid; selectedResult = grid.DataContext as SearchResult; OptionSelected(SearchOption.Navigate); }
private void MenuItem_Click(object sender, System.Windows.RoutedEventArgs e) { // Get the option according to the item's name var menuItem = sender as MenuItem; SearchOption searchOption = (SearchOption)Enum.Parse(typeof(SearchOption), menuItem.Name, false); // Start with closing the context menu var contextMenu = menuItem.Parent as ContextMenu; contextMenu.IsOpen = false; // No need for a callback on cancel if (searchOption == SearchOption.Cancel) { return; } else { selectedResult = menuItem.DataContext as SearchResult; if (searchOption == SearchOption.AddToFavorites) { InputGrid.Visibility = System.Windows.Visibility.Visible; } else { OptionSelected(searchOption); } } }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { // Start with calling the base implementation base.OnNavigatedTo(e); this.SupportedOrientations = GamePage.get().SupportedOrientations; // Set the page's state according to the context if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back) { this.PageContext = NavigationContext.GetData <SingleSearchResultsPivotPageContext>(); this.PageContext = this.PageContext; this.DataContext = this; this.selectedResult = null; if (!(string.IsNullOrEmpty(this.PageContext.LocalSearchProviderLabel))) { LocalSearchPivotItem.Header = this.PageContext.LocalSearchProviderLabel; } // Translate the page according to the local language (must be after the context handling) LanguageResources.Instance.UpdateControl(this); } }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { // Start with calling the base implementation base.OnNavigatedTo(e); this.SupportedOrientations = GamePage.get().SupportedOrientations; // Set the page's state according to the context if (e.NavigationMode != System.Windows.Navigation.NavigationMode.Back) { this.PageContext = NavigationContext.GetData<SingleSearchResultsPivotPageContext>(); this.PageContext = this.PageContext; this.DataContext = this; this.selectedResult = null; if (!(string.IsNullOrEmpty(this.PageContext.LocalSearchProviderLabel))) { LocalSearchPivotItem.Header = this.PageContext.LocalSearchProviderLabel; } // Translate the page according to the local language (must be after the context handling) LanguageResources.Instance.UpdateControl(this); } }
private void SearchResultItemGrid_Tap(object sender, System.Windows.Input.GestureEventArgs e) { var grid = sender as Grid; selectedResult = grid.DataContext as SearchResult; OptionSelected(SearchOption.Navigate); }
private void MenuItem_Click(object sender, System.Windows.RoutedEventArgs e) { // Get the option according to the item's name var menuItem = sender as MenuItem; SearchOption searchOption = (SearchOption)Enum.Parse(typeof(SearchOption), menuItem.Name, false); // Start with closing the context menu var contextMenu = menuItem.Parent as ContextMenu; contextMenu.IsOpen = false; // No need for a callback on cancel if (searchOption == SearchOption.Cancel) { return; } else { selectedResult = menuItem.DataContext as SearchResult; if (searchOption == SearchOption.AddToFavorites) { InputGrid.Visibility = System.Windows.Visibility.Visible; } else { OptionSelected(searchOption); } } }