private async void asbox_Search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {


            Func<HPUserDetail, string> f = h => h.ou;

            setWorking(true);

            string searchText = args.ChosenSuggestion == null ? args.QueryText : args.ChosenSuggestion.ToString();
            SearchInfo result = null;
            try
            {
                result = await PeopleFinderHelper.Search(searchText);
                tbl_Msg.Text = "";
            }
            catch(Exception ex)
            {
                tbl_Msg.Text = ex.Message;
            }
            
            var myResult = result?.result.GroupBy(g => new { g.co, g.c}).OrderBy(o => o.Key.co).Select(gu => new PeopleFinderViewModel() { Group = gu.Key.co,SecondGroup=gu.Key.c, Peoples = gu.ToList() });
            ViewModel = myResult;

           
            this.Bindings.Update();

            setWorking(false);




        }
        private async void FromStationText_OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            string textSubmitted = args.QueryText; //query from user

            if (textSubmitted.Length > 3)
            {
                //user searched for new station, clear list from old stations.
                FromStopLocations.Clear();
                //call api to get stations from user inputted text
                Task t = ApiCaller.PopulateStopLocationsAsync(FromStopLocations, textSubmitted);
                await t;

                //populate autosuggestionbox
                fromStationText.ItemsSource = FromStopLocations;
                IsReadyForSearch();
            }
            else
            {
                //user did not input more than three letters
                FromStopLocations.Clear();

                //dirty way to show error message
                string noResults = "Skriv mer än tre bokstäver...";
                var notCorrectEntry = new StopLocation {name = noResults};
                FromStopLocations.Add(notCorrectEntry);

                //add to autosuggestionbox
                fromStationText.ItemsSource = FromStopLocations;
            }
        }
 private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     ForView.Unwrap<SubscriptionViewModel>(DataContext, vm =>
     {
         vm.QuerySubmitted();
     });
 }
 /// <summary>
 /// Invoked when a custom name is entered for a list item.
 /// </summary>
 /// <param name="sender">The name entry box</param>
 /// <param name="args">Event arguments</param>
 private void nameBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     var vm = DataContext as Favourites;
     var platform = sender.DataContext as DataStorage.Favourite;
     vm.ChangeCustomName(platform.PlatformNo, sender.Text);
     this.editFlyout.Hide();
 }
        private async void ui_search_autosuggestboxFrom_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            string stationSearchedFor = args.QueryText;

            if (string.IsNullOrWhiteSpace(stationSearchedFor) || stationSearchedFor.Length <= 3)
            {
                //user did not input more than three letters
                FromStopLocations.Clear();
                _fromId = "";

                //dirty way to show error message
                const string noResults = "Skriv mer än tre bokstäver...";
                StopLocation notCorrectEntry = new StopLocation { name = noResults };
                FromStopLocations.Add(notCorrectEntry);
                IsReadyForSearch();

                //add to autosuggestionbox
                ui_search_autosuggestboxFrom.ItemsSource = FromStopLocations;

                return;
            }
            else
            {
                //user searched for new station, clear list from old stations.
                FromStopLocations.Clear();
                //call api to get stations from user inputted text
                await ApiCaller.SearchForStationAsync(FromStopLocations, stationSearchedFor);

                //populate autosuggestionbox
                ui_search_autosuggestboxFrom.ItemsSource = FromStopLocations;

            }

        }
 private void Searchbox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (!string.IsNullOrWhiteSpace(args.QueryText))
     {
         this.RootFrame?.NavigateAsync(typeof(Views.SearchPage), args.QueryText);
     }
 }
        private void OnQuerySubmitted(AutoSuggestBox box, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            AutoSuggestBox.Text = "";

            var hamburger = box.GetVisualParentOfType<Hamburger>();
            hamburger.IsPaneOpen = false;
        }
 private void SearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (sender.Text.Length > 0)
     {
         SearchResultPanel.StartSearch(Frame, sender.Text);
     }
 }
 private void SearchAutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     SoundManager.GetSoundsByName(Sounds, sender.Text);
     CategoryTextBlock.Text = sender.Text;
     MenuItemsListView.SelectedItem = null;
     BackButton.Visibility = Visibility.Visible;
 }
 private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     ForView.Unwrap<SearchViewModel>(DataContext, vm =>
     {
         vm.QuerySubmitted();
     });
     ResultsList.Focus(FocusState.Keyboard);
 }
 /// <summary>
 /// 发表回应
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void MyComment_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (!MyComment.Text.Equals(""))
     {
         _totalHtml = _totalHtml.Replace("<a id='ok'></a>", "") + ChatBoxTool.Send("http://pic.cnblogs.com/avatar/624159/20150505133758.png", "青柠檬", MyComment.Text, DateTime.Now.ToString()) + "<a id='ok'></a>";
         FlashComment.NavigateToString(_totalHtml);
     }
 }
 private void FoundServiceSubmitted(
     AutoSuggestBox sender,
     AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     var choosenService = (args.ChosenSuggestion as ServiceInformation);
     if (choosenService != null)
     {
         ConcreteDataContext.NavigateToService.Execute(choosenService);
     }
 }
 private async void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     string message = $"query: {args.QueryText}";
     if (args.ChosenSuggestion != null)
     {
         message += $" suggestion: {args.ChosenSuggestion}";
     }
     var dlg = new MessageDialog(message);
     await dlg.ShowAsync();
 }
 private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (args.ChosenSuggestion != null)
     {
         // User selected an item from the suggestion list, take an action on it here.
     }
     else
     {
         // Use args.QueryText to determine what to do.
     }
 }
Exemple #15
0
 private void searchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (args.ChosenSuggestion == null)
     {
         string[] temp = searchBox.Text.TrimEnd(searchBoxTagSeparator).Split(searchBoxTagSeparator);
         System.Collections.Generic.List<string> tagsList = new System.Collections.Generic.List<string>();
         foreach (string tag in temp)
             tagsList.Add(tag.Replace(' ','_').Trim('"'));
         Shell.ContentFrame.Navigate(typeof(SearchResultsPage), tagsList);
     }
 }
 private void controlsSearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (args.ChosenSuggestion != null && args.ChosenSuggestion is ControlInfoDataItem)
     {
         var itemId = (args.ChosenSuggestion as ControlInfoDataItem).UniqueId;
         NavigationRootPage.RootFrame.Navigate(typeof(ItemPage), itemId);
     }
     else if (!string.IsNullOrEmpty(args.QueryText))
     {
         NavigationRootPage.RootFrame.Navigate(typeof(SearchResultsPage), args.QueryText);
     }
 }
        private async void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            if (!string.IsNullOrEmpty(args.QueryText))
            {
                this.CancelTokenSource();

                using (TokenSource = new CancellationTokenSource())
                {
                    try
                    {
                        this.IsRefreshButtonEnabled = false;
                        this.IsLoading = true;
                        Users.Clear();

                        List<Microsoft.Graph.IUser> allusers = await Search(sender.Text, TokenSource.Token);

                        this.ListViewResearch.Focus(FocusState.Programmatic);

                        // Updating all organizers
                        List<string> usersMail = new List<string>();

                        foreach (var ev in allusers)
                            usersMail.AddRange(allusers.Select(u => u.UserPrincipalName).ToList());

                        var distinctUsers = usersMail.Distinct().ToList();
                        await UserViewModel.UpdateUsersFromSharepointAsync(distinctUsers, TokenSource.Token);

                        foreach (var user in allusers)
                            Users.Add(UserViewModel.GetUser(user.UserPrincipalName));

                        this.IsLoading = false;
                    }
                    catch (TaskCanceledException ex)
                    {
                        Debug.WriteLine("Task canceled " + ex.Message);
                    }
                    catch (OperationCanceledException ex)
                    {
                        Debug.WriteLine("Operation canceled " + ex.Message);
                    }
                    catch (Exception ex)
                    {
                        Debug.WriteLine("Exception " + ex.Message);
                    }
                    finally
                    {
                        this.IsRefreshButtonEnabled = true;
                        this.IsLoading = false;
                        this.ListViewResearch.Focus(FocusState.Programmatic);
                    }
                }
            }
        }
 private void autoBox_Search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     
     if(args.ChosenSuggestion != null)
     {
         getData(args.ChosenSuggestion.ToString());
         emailList.Add(args.ChosenSuggestion.ToString());
     }
     else
     {
         getData(args.QueryText);
         emailList.Add(args.QueryText);
     }
     
 }
        /// <summary>
        /// This event gets fired when:
        ///     * a user presses Enter while focus is in the TextBox
        ///     * a user clicks or tabs to and invokes the query button (defined using the QueryIcon API)
        ///     * a user presses selects (clicks/taps/presses Enter) a suggestion
        /// </summary>
        /// <param name="sender">The AutoSuggestBox that fired the event.</param>
        /// <param name="args">The args contain the QueryText, which is the text in the TextBox, 
        /// and also ChosenSuggestion, which is only non-null when a user selects an item in the list.</param>
        private void asb_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            if (args.ChosenSuggestion != null)
            {
                // User selected an item, take an action on it here
                SelectContact((Contact)args.ChosenSuggestion);
            }
            else
            {
                // Do a fuzzy search on the query text
                var matchingContacts = ContactSampleDataSource.GetMatchingContacts(args.QueryText);

                // Choose the first match, or clear the selection if there are no matches.
                SelectContact(matchingContacts.FirstOrDefault());
            }
        }
Exemple #20
0
        private void autoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            if (args.ChosenSuggestion == null)
            {
                String searchtext = args.QueryText.ToUpper();
                PubsListView.SelectedItem = null;
                PubsListView.UpdateLayout();

                foreach (LocationData data in pubList)
                {
                    var container = (SelectorItem)PubsListView.ContainerFromItem(data);
                    if (container != null)
                    {
                        container.IsSelected = false;
                    }
                }

                foreach (LocationData data in pubList)
                {
                    String name = data.name.ToUpper();
                    String city = data.city.ToUpper();

                    if (name.Contains(searchtext))
                    {
                        var container = (SelectorItem)PubsListView.ContainerFromItem(data);
                        if (container != null)
                        {
                            container.IsSelected = true;
                            //PubsListView.SelectedIndex = pubList.IndexOf(data);
                            PubsListView.UpdateLayout();
                            PubsListView.ScrollIntoView(PubsListView.SelectedItem);
                        }
                    }
                    else if(city.Contains(searchtext))
                    {
                        var container = (SelectorItem)PubsListView.ContainerFromItem(data);
                        if (container != null)
                        {
                            container.IsSelected = true;
                            //PubsListView.SelectedIndex = pubList.IndexOf(data);
                            PubsListView.UpdateLayout();
                            PubsListView.ScrollIntoView(data);
                        }
                    }
                }
            }
        }
 /// <summary>
 /// This event gets fired when:
 ///     * a user presses Enter while focus is in the TextBox
 ///     * a user clicks or tabs to and invokes the query button (defined using the QueryIcon API)
 ///     * a user presses selects (clicks/taps/presses Enter) a suggestion
 /// </summary>
 /// <param name="sender">The AutoSuggestBox that fired the event.</param>
 /// <param name="args">The args contain the QueryText, which is the text in the TextBox, 
 /// and also ChosenSuggestion, which is only non-null when a user selects an item in the list.</param>
 private async void Control2_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (args.ChosenSuggestion != null && args.ChosenSuggestion is ControlInfoDataItem)
     {
         //User selected an item, take an action
         SelectControl(args.ChosenSuggestion as ControlInfoDataItem);
     }
     else if (!string.IsNullOrEmpty(args.QueryText))
     {
         //Do a fuzzy search based on the text
         var suggestions = await SearchControls(sender.Text);
         if(suggestions.Count > 0)
         {
             SelectControl(suggestions.FirstOrDefault());
         }
     }
 }
 /// <summary>
 /// 发布回复
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private async void MyReply_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (!MyReply.Text.Equals(""))
     {
         MyReply.IsEnabled = false;
         string reply = MyReply.Text;
         MyReply.Text = "正在发送回复...";
         object result = await UserService.ReplyMsg(_msg_id, reply);
         if (result != null)
         {
             _totalHtml = _totalHtml.Replace("<a id='ok'></a>", "") + ChatBoxTool.Send(App.LoginedUser.Avatar, App.LoginedUser.Name, reply, DateTime.Now.ToString()) + "<a id='ok'></a>";
             MsgContent.NavigateToString(_totalHtml);
         }
         else
         {
             await (new MessageDialog("回复失败!")).ShowAsync();
         }
         MyReply.IsEnabled = true;
         MyReply.Text = "";
     }
 }
        private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            SampleDataModel FoundItem = null;

            if (args.ChosenSuggestion != null && args.ChosenSuggestion is SampleDataModel)
            {
                FoundItem = args.ChosenSuggestion as SampleDataModel;
            }
            else if (String.IsNullOrEmpty(args.QueryText) == false)
            {
                foreach (var Item in AllItems)
                {
                    if (Item.Title.Equals(args.QueryText, StringComparison.OrdinalIgnoreCase))
                    {
                        FoundItem = Item;
                        break;
                    }
                }
            }

            ShowItem(FoundItem);
        }
        /// <summary>
        /// This event gets fired when:
        ///     * a user presses Enter while focus is in the TextBox
        ///     * a user clicks or tabs to and invokes the query button (defined using the QueryIcon API)
        ///     * a user presses selects (clicks/taps/presses Enter) a suggestion
        /// </summary>
        /// <param name="sender">The AutoSuggestBox that fired the event.</param>
        /// <param name="args">The args contain the QueryText, which is the text in the TextBox, 
        /// and also ChosenSuggestion, which is only non-null when a user selects an item in the list.</param>
        private void AutoSuggestName_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            //if (args.ChosenSuggestion != null)
            //{
            //    //User selected an item, take an action on it here
            //    SelectContact(args.ChosenSuggestion as Contact);
            //}
            //else
            //{
            //    //Do a fuzzy search on the query text
            //    var matchingContacts = ContactSampleDataSource.GetMatchingContacts(args.QueryText);

            //    if (matchingContacts.Count() >= 1)
            //    {
            //        //Choose the first match
            //        SelectContact(matchingContacts.FirstOrDefault());
            //    }
            //    else
            //    {
            //        NoResults.Visibility = Visibility.Visible;
            //    }
            //}
        }
        private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
          //  if (args.ChosenSuggestion != null)
          //  {
          //      //User selected an item, take an action on it here
          //      var zipCode = args.ChosenSuggestion as ZipCode;
          //      sender.Text = zipCode.Zip;
          //  }
          //  else
          //  {
          //      //Do a fuzzy search on the query text
          //      var zipCode = _zipCodes.Find(args.QueryText).FirstOrDefault();

          //      if (zipCode != null)
          //      {
          //          //Choose the first match
          //          sender.Text = zipCode.Zip;
          //      }
          //      else
          //      {
          ////          NoResults.Visibility = Visibility.Visible;
          //      }
          //  }
        }
Exemple #26
0
 private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     (this.DataContext as MainPageViewModel).NavigationService.Navigate(typeof(SearchPage), sender.Text);
 }
 internal void RaiseQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     QuerySubmitted?.Invoke(sender, args);
 }
 private async void Search_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     await ShellView.NavigationService.NavigateAsync("SearchPage", ("SearchTerm", sender.Text));
 }
 private async void SearchSubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (sender.Text.Length > 0)
     {
         await Task.Delay(100);
         Frame.Navigate(typeof(page.SearchResult), sender.Text);
     }
 }
        private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            var queryText = args.ChosenSuggestion?.ToString() ?? args.QueryText;

            ViewModel.Search(queryText ?? string.Empty);
        }
Exemple #31
0
 private void SearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args) => ShowSearchResultsStoryboard.Begin();
Exemple #32
0
 private void MyAutoSuggest_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
 }
Exemple #33
0
 private void SearchAutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     SoundManager.GetSoundsByName(sounds, sender.Text);
 }
 private void SearchSuggestBox_OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     SoundItemManager.FilterItemByName(Sounds, sender.Text);
     BackButton.Visibility = Visibility.Visible;
 }
Exemple #35
0
 private void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     QuerySubmittedCommand?.TryExecute(args.QueryText);
 }
Exemple #36
0
        private async void Location_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            LocationQueryViewModel query_vm = null;

            if (args.ChosenSuggestion != null)
            {
                // User selected an item from the suggestion list, take an action on it here.
                var theChosenOne = args.ChosenSuggestion as LocationQueryViewModel;

                if (!String.IsNullOrEmpty(theChosenOne.LocationQuery))
                {
                    query_vm = theChosenOne;
                }
                else
                {
                    query_vm = new LocationQueryViewModel();
                }
            }
            else if (!String.IsNullOrEmpty(args.QueryText))
            {
                // Use args.QueryText to determine what to do.
                var result = (await wm.GetLocations(args.QueryText)).First();

                if (result != null && !String.IsNullOrWhiteSpace(result.LocationQuery))
                {
                    sender.Text = result.LocationName;
                    query_vm    = result;
                }
                else
                {
                    query_vm = new LocationQueryViewModel();
                }
            }
            else if (String.IsNullOrWhiteSpace(args.QueryText))
            {
                // Stop since there is no valid query
                return;
            }

            if (String.IsNullOrWhiteSpace(query_vm.LocationQuery))
            {
                // Stop since there is no valid query
                return;
            }

            // Cancel other tasks
            cts.Cancel();
            cts = new CancellationTokenSource();
            var ctsToken = cts.Token;

            LoadingRing.IsActive = true;

            if (ctsToken.IsCancellationRequested)
            {
                LoadingRing.IsActive = false;
                return;
            }

            // Check if location already exists
            var locData = await Settings.GetLocationData();

            if (locData.Exists(l => l.query == query_vm.LocationQuery))
            {
                LoadingRing.IsActive = false;
                ShowAddLocationsPanel(false);
                return;
            }

            if (ctsToken.IsCancellationRequested)
            {
                LoadingRing.IsActive = false;
                return;
            }

            var location = new LocationData(query_vm);

            if (!location.IsValid())
            {
                await Toast.ShowToastAsync(App.ResLoader.GetString("WError_NoWeather"), ToastDuration.Short);

                LoadingRing.IsActive = false;
                return;
            }
            var weather = await Settings.GetWeatherData(location.query);

            if (weather == null)
            {
                try
                {
                    weather = await wm.GetWeather(location);
                }
                catch (WeatherException wEx)
                {
                    weather = null;
                    await Toast.ShowToastAsync(wEx.Message, ToastDuration.Short);
                }
            }

            if (weather == null)
            {
                LoadingRing.IsActive = false;
                return;
            }

            // We got our data so disable controls just in case
            sender.IsSuggestionListOpen = false;

            // Save data
            await Settings.AddLocation(location);

            if (wm.SupportsAlerts && weather.weather_alerts != null)
            {
                await Settings.SaveWeatherAlerts(location, weather.weather_alerts);
            }
            await Settings.SaveWeatherData(weather);

            var panelView = new LocationPanelViewModel(weather)
            {
                LocationData = location
            };

            // Set properties if necessary
            if (EditMode)
            {
                panelView.EditMode = true;
            }

            // Add to collection
            LocationPanels.Add(panelView);

            // Hide add locations panel
            LoadingRing.IsActive = false;
            ShowAddLocationsPanel(false);
        }
Exemple #37
0
 private void SearchAutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     CategoryTextBlock.Text         = sender.Text;
     MenuItemsListView.SelectedItem = null;
     BackButton.Visibility          = Visibility.Visible;
 }
Exemple #38
0
 private void AddressAutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     Navigate(AddressAutoSuggestBox.Text);
     currentWebView.Focus(FocusState.Programmatic);
 }
 private void Search_Submitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     UpdateSearch();
 }
 private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     ViewModel.SearchArtistCommand.Execute();
 }
        private async void SearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            if (args.ChosenSuggestion is GenericMusicItemViewModel g)
            {
                if (g.Title.IsNullorEmpty())
                {
                    return;
                }
                if (g.InnerType == MediaType.Placeholder)
                {
                    SearchBox.Text = g.Title;
                    return;
                }
                if (g.InnerType == MediaType.Album)
                {
                    var view   = new AlbumViewDialog(await g.FindAssociatedAlbumAsync());
                    var result = await view.ShowAsync();
                }
                else
                {
                    var t = Task.Run(async() =>
                    {
                        await SQLOperator.Current().SaveSearchHistoryAsync(g.Title);
                    });
                    var dialog = new SearchResultDialog(g);
                    var result = await dialog.ShowAsync();

                    if (result == ContentDialogResult.Secondary)
                    {
                        ShowModalUI(true, "Prepare to Show");
                        var view = new AlbumViewDialog(await g.FindAssociatedAlbumAsync());
                        ShowModalUI(false);
                        result = await view.ShowAsync();
                    }
                }
            }
            else
            {
                if (Context.SearchItems.IsNullorEmpty())
                {
                    var dialog = new SearchResultDialog();
                    var result = await dialog.ShowAsync();
                }
                else
                {
                    if (Context.SearchItems[0].InnerType == MediaType.Placeholder)
                    {
                        SearchBox.Text = Context.SearchItems[0].Title;
                        return;
                    }
                    var t = Task.Run(async() =>
                    {
                        await SQLOperator.Current().SaveSearchHistoryAsync(Context.SearchItems[0].Title);
                    });
                    if (Context.SearchItems[0].InnerType == MediaType.Album)
                    {
                        var view   = new AlbumViewDialog(await Context.SearchItems[0].FindAssociatedAlbumAsync());
                        var result = await view.ShowAsync();
                    }
                    else
                    {
                        var dialog = new SearchResultDialog(Context.SearchItems[0]);
                        var result = await dialog.ShowAsync();

                        if (result == ContentDialogResult.Secondary)
                        {
                            ShowModalUI(true, "Prepare to Show");
                            var view = new AlbumViewDialog(await Context.SearchItems[0].FindAssociatedAlbumAsync());
                            ShowModalUI(false);
                            result = await view.ShowAsync();
                        }
                    }
                }
            }
            sender.Text = string.Empty;
        }
Exemple #42
0
 private void searchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     this.Focus(FocusState.Programmatic);
 }
        public void CompactOverlayAutoSuggestBox_AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            var item = args.QueryText;

            CompactOverlay_QueryWord(item);
        }
 private async void OnPersonNameQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     await this.AddPerson(args.ChosenSuggestion != null?args.ChosenSuggestion.ToString() : args.QueryText);
 }
 private void TxtSearch_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (string.IsNullOrEmpty(args.QueryText) == false)
     {
         Frame.Navigate(typeof(SearchView), sender.Text);
     }
 }
 private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     Debug.WriteLine("QuerySubmitted: " + args.QueryText);
 }
Exemple #47
0
 private async void OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     var query = args.QueryText;
     await Default.LaunchSearch(query);
 }
 private void AutoSuggestBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     webView.Navigate(new Uri("https://stackoverflow.com/search?q=" + args.QueryText));
 }
Exemple #49
0
        private async void SearchText_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            //this is the click of serach button
            if (args.ChosenSuggestion == null)
            {
                string item = args.QueryText as string;
                Task<List<Article>> task = getArticles(item);
                Articles = await task;

                articlesGrid.ItemsSource = Articles;
            }
        }
Exemple #50
0
 private void SearchBox_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
 }
 private void OnSearchQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     if (SearchToggleButton.IsChecked.HasValue && SearchToggleButton.IsChecked.Value)
     {
         SearchBox.Visibility = Visibility.Collapsed;
         SearchToggleButton.Visibility = Visibility.Visible;
         SearchToggleButton.IsChecked = false;
     }
 }
Exemple #52
0
 private void autoSug_Box_QuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
 {
     MessageCenter.SendNavigateTo(NavigateMode.Info, typeof(SearchPage), new object[] { txt_auto_Find.Text });
 }