private void txtsearchbykeyword_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
 {
     try
     {
         if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
         {
             Students = new ObservableCollection <Students>();
             if (vm.GetStudents != null)
             {
                 foreach (var items in vm.GetStudents)
                 {
                     if (!string.IsNullOrEmpty(items.studentName) || items.studentName != null)
                     {
                         if (txtsearchbykeyword.Text != string.Empty)
                         {
                             if (items.studentName.ToUpper().StartsWith(txtsearchbykeyword.Text.ToUpper()) || items.studentName.ToLower().StartsWith(txtsearchbykeyword.Text.ToLower()))
                             {
                                 Students.Add(items);
                             }
                         }
                     }
                 }
                 txtsearchbykeyword.ItemsSource = Students;
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
        private void StopEntryTextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            try
            {
                linePicker.Items.Clear();
                var station = DataFeedClient.Basic.Stations.FindByName(stopEntry.Text);
                linePicker.IsEnabled = station != null;
                if (station != null)
                {
                    foreach (var item in station.GetThroughgoingRoutes().Select(r => r.Label).Distinct())
                    {
                        linePicker.Items.Add(item);
                    }
                }

                if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
                {
                    ((AutoSuggestBox)sender).ItemsSource = DataFeedClient.Basic.Stations.Where(x => x.Name.StartsWith(((AutoSuggestBox)sender).Text, StringComparison.InvariantCultureIgnoreCase)).Select(x => x.Name).ToList();
                }
            }
            catch
            {
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                Request.CheckBasicDataValidity();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
            }
        }
Esempio n. 3
0
 private async void txtsearchbykeyword_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
 {
     try
     {
         if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
         {
             ListArea = new ObservableCollection <AreaModel>();
             if (VM.AreaModelList != null)
             {
                 foreach (var items in VM.AreaModelList)
                 {
                     if (!string.IsNullOrEmpty(items.areaName) || items.areaName != null)
                     {
                         if (txtsearchbykeyword.Text != string.Empty)
                         {
                             VM.AreaName = txtsearchbykeyword.Text;
                             if (items.areaName.ToUpper().StartsWith(VM.AreaName.ToUpper()) || items.areaName.ToLower().StartsWith(VM.AreaName.ToLower()))
                             {
                                 ListArea.Add(items);
                             }
                         }
                     }
                 }
                 txtsearchbykeyword.ItemsSource = ListArea;
             }
             else
             {
                 await DisplayAlert("HMS", "No Matching Area Name", "OK");
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 4
0
        private void txtsearchbyhostel_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            //try
            //{
            //    if (e.Reason == dotMorten.Xamarin.Forms.AutoSuggestionBoxTextChangeReason.UserInput)
            //    {
            //        hostelModels = new ObservableCollection<HostelModel>();
            //        if (vm.HostelModelList != null)
            //        {
            //            foreach (var items in vm.HostelModelList)
            //            {
            //                if (!string.IsNullOrEmpty(items.hostelName))
            //                {
            //                    if (!string.IsNullOrEmpty(txtsearchbyhostel.Text))
            //                    {
            //                        if (items.hostelName.ToUpper().StartsWith(txtsearchbyhostel.Text.ToUpper()) || items.hostelName.ToLower().StartsWith(txtsearchbyhostel.Text.ToLower()))
            //                            hostelModels.Add(items);
            //                    }
            //                }
            //            }
            //            txtsearchbyhostel.ItemsSource = hostelModels;
            //        }
            //    }
            //}
            //catch
            //{

            //}
        }
 private void txtselectbyarea_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
 {
     try
     {
         if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
         {
             areaModels = new ObservableCollection <AreaModel>();
             if (vm.AreaLists != null)
             {
                 foreach (var items in vm.AreaLists)
                 {
                     if (!string.IsNullOrEmpty(items.areaName) || items.areaName != null)
                     {
                         if (txtselectbyarea.Text != string.Empty)
                         {
                             if (items.areaName.ToUpper().StartsWith(txtselectbyarea.Text.ToUpper()) || items.areaName.ToLower().StartsWith(txtselectbyarea.Text.ToLower()))
                             {
                                 areaModels.Add(items);
                             }
                         }
                     }
                 }
                 txtselectbyarea.ItemsSource = areaModels;
             }
             else
             {
                 DisplayAlert("HMS", "No Matching Area Name", "OK");
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 6
0
 private void txtsearchbykeyword_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
 {
     try
     {
         if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
         {
             leaveTypes = new ObservableCollection <LeaveTypeModel>();
             if (Vm.LeaveTypeList != null)
             {
                 foreach (var items in Vm.LeaveTypeList)
                 {
                     if (!string.IsNullOrEmpty(items.name))
                     {
                         if (!string.IsNullOrEmpty(txtsearchbykeyword.Text))
                         {
                             if (items.name.ToUpper().StartsWith(txtsearchbykeyword.Text.ToUpper()) || items.name.ToLower().StartsWith(txtsearchbykeyword.Text.ToLower()))
                             {
                                 leaveTypes.Add(items);
                             }
                         }
                     }
                 }
                 txtsearchbykeyword.ItemsSource = leaveTypes;
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 7
0
        private void txtsearchbykeyword_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            //try
            //{
            //    if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            //    {
            //        wardenInfoModels = new ObservableCollection<StudentProfileModel>();
            //        if (vm.WardenInfoModels != null)
            //        {
            //            foreach (var items in vm.WardenInfoModels)
            //            {
            //                if (!string.IsNullOrEmpty(items.wardenName))
            //                {
            //                    if (!string.IsNullOrEmpty(txtsearchbykeyword.Text))
            //                    {
            //                        if (items.wardenName.ToUpper().StartsWith(txtsearchbykeyword.Text.ToUpper()) || items.wardenName.ToLower().StartsWith(txtsearchbykeyword.Text.ToLower()))
            //                            wardenInfoModels.Add(items);
            //                    }
            //                }
            //            }
            //            txtsearchbykeyword.ItemsSource = wardenInfoModels;
            //        }
            //    }
            //}
            //catch (Exception ex)
            //{

            //}
        }
Esempio n. 8
0
        private void AutoSuggestBox_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            {
                List <string> suggestionList = new List <string>();
                string        searchString   = inputBox.Text.ToUpper().Replace(" ", string.Empty);

                foreach (string course in helperServices.allCourses)
                {
                    if (course.StartsWith(searchString))
                    {
                        suggestionList.Add(course);
                    }
                }

                if (searchString == string.Empty)
                {
                    inputBox.ItemsSource = helperServices.allCourses;
                }
                else
                {
                    //Set the ItemsSource to be your filtered dataset
                    inputBox.ItemsSource = suggestionList;
                }
            }
        }
Esempio n. 9
0
 private void txtsearchbykeyword_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
 {
     try
     {
         if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
         {
             wardenInfos = new ObservableCollection <WardenInfoModel>();
             if (vm.WardenInfoModels != null)
             {
                 foreach (var items in vm.WardenInfoModels)
                 {
                     if (!string.IsNullOrEmpty(items.firstName))
                     {
                         if (!string.IsNullOrEmpty(txtsearchbykeyword.Text))
                         {
                             if (items.firstName.ToUpper().StartsWith(txtsearchbykeyword.Text.ToUpper()) || items.firstName.ToLower().StartsWith(txtsearchbykeyword.Text.ToLower()))
                             {
                                 wardenInfos.Add(items);
                             }
                         }
                     }
                 }
                 txtsearchbykeyword.ItemsSource = wardenInfos;
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
 private void ItemAutoSuggestBox_TextChanged(AutoSuggestBox sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
 {
     if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput && sender.Text != "")
     {
         sender.ItemsSource = itemsNameList.Where(i => i.StartsWith(ItemAutoSuggestBox.Text, StringComparison.InvariantCultureIgnoreCase)).ToList();
     }
 }
        private void txtsearchbykeyword_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            //try
            //{
            //    if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            //    {
            //        ListHostel = new ObservableCollection<HostalMasterModel>();
            //        if (vm.HostalMasterData != null)
            //        {
            //            foreach (var item in vm.HostalMasterData)
            //            {
            //                if (!string.IsNullOrEmpty(item.hostelName) || item.hostelName != null)
            //                {
            //                    //VM.AreaVisible = !VM.AreaVisible;
            //                    if (txtsearchbykeyword.Text != string.Empty)
            //                    {
            //                        if (item.hostelName.ToUpper().StartsWith(txtsearchbykeyword.Text.ToUpper()) || item.hostelName.ToLower().StartsWith(txtsearchbykeyword.Text.ToLower()))
            //                            ListHostel.Add(item);
            //                    }
            //                }
            //            }
            //            txtsearchbykeyword.ItemsSource = ListHostel;
            //        }
            //    }
            //}
            //catch (Exception ex)
            //{

            //}
        }
Esempio n. 12
0
 private void txtsearchbyarea_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
 {
     try
     {
         if (e.Reason == dotMorten.Xamarin.Forms.AutoSuggestionBoxTextChangeReason.UserInput)
         {
             areaModels = new ObservableCollection <AreaModel>();
             if (vm.AreaModel != null)
             {
                 foreach (var items in vm.AreaModel)
                 {
                     if (!string.IsNullOrEmpty(items.areaName))
                     {
                         if (!string.IsNullOrEmpty(txtsearchbyarea.Text))
                         {
                             if (items.areaName.ToUpper().StartsWith(txtsearchbyarea.Text.ToUpper()) || items.areaName.ToLower().StartsWith(txtsearchbyarea.Text.ToLower()))
                             {
                                 areaModels.Add(items);
                             }
                         }
                         else
                         {
                         }
                     }
                 }
                 txtsearchbyarea.ItemsSource = areaModels;
             }
         }
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 13
0
 private void AutoSuggestBox_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs args)
 {
     if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
     {
         // Definir o ItemsSource como seu conjunto de dados filtrado
         // sender.ItemsSource = dataset;
         FiltrarClientes((sender as AutoSuggestBox).Text, sender);
     }
 }
Esempio n. 14
0
        private void House_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            var box = sender as dotMorten.Xamarin.Forms.AutoSuggestBox;

            if (viewModel.Houses != null)
            {
                box.ItemsSource =
                    viewModel.Houses.Select(x => x.Address).ToList();
            }
        }
Esempio n. 15
0
        private void District_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            var box = sender as dotMorten.Xamarin.Forms.AutoSuggestBox;

            if (e.Reason == dotMorten.Xamarin.Forms.AutoSuggestionBoxTextChangeReason.UserInput)
            {
                box.ItemsSource =
                    viewModel.Districts.Select(x => x.Name).Where(y => y.ToUpper().Contains(box.Text.ToUpper())).ToList();
            }
        }
Esempio n. 16
0
 private void _txtSearch_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
 {
     if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
     {
         Task.Run(async() =>
         {
             var source = ControllerRepository.Y(x => x.GetSuggestQueries(_txtSearch.Text)).Await()?.ToList();
             Device.BeginInvokeOnMainThread(() =>
             {
                 _txtSearch.ItemsSource = source;
             });
         });
     }
 }
Esempio n. 17
0
        private void StopEntryTextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            {
                try
                {
                    ((AutoSuggestBox)sender).ItemsSource = DataFeedClient.Basic.Stations.Where(x => x.Name.StartsWith(((AutoSuggestBox)sender).Text, StringComparison.InvariantCultureIgnoreCase)).Select(x => x.Name).ToList();
                }
                catch
                {
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                    Request.CheckBasicDataValidity();
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                }
            }
        }
Esempio n. 18
0
        private void AutoSuggestBox_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            {
                if (!string.IsNullOrEmpty(autosuggestview.Text))
                {
                    _viewModel.IsPageEnabled = true;
                    _viewModel.GetPatientInfo(autosuggestview.Text);

                    _viewModel.IsPageEnabled = false;
                }
            }
            else if (e.Reason == AutoSuggestionBoxTextChangeReason.SuggestionChosen)
            {
                _viewModel.PatientName = autosuggestview.Text;
                _viewModel.GetPatientsList("PatientName");
            }
        }
Esempio n. 19
0
        private async void OnChangeDestiny(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs args)
        {
            AutoSuggestBox box = (AutoSuggestBox)sender;

            if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            {
                if (string.IsNullOrWhiteSpace(box.Text) || box.Text.Length < 3)
                {
                    box.ItemsSource = null;
                }
                else
                {
                    var suggestions = await this.ViewModel.GetSuggestions(box.Text);

                    box.ItemsSource = suggestions.ToList();
                }
            }
        }
Esempio n. 20
0
        private void AutoSuggestBox_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            AutoSuggestBox box = (AutoSuggestBox)sender;

            if (e.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            {
                if (string.IsNullOrWhiteSpace(box.Text))
                {
                    box.ItemsSource = null;
                    lv.ItemsSource  = ViewModel.Pokemons;
                }
                else
                {
                    var suggestions = ViewModel.AutoComplete(box.Text);
                    box.ItemsSource = suggestions.ToList();
                }
            }
        }
Esempio n. 21
0
        private void SuggestBox_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs e)
        {
            AutoSuggestBox box  = (AutoSuggestBox)sender;
            var            text = box.Text;

            if (string.IsNullOrEmpty(text))
            {
                box.ItemsSource = null;
                return;
            }
            var    suggestions = AutoCompleteEmailNames.Select(t => text + "@" + AutoCompleteEmailNames);
            string domain      = "";
            int    idx         = text.IndexOf("@");

            if (idx > -1)
            {
                domain = text.Substring(idx + 1).ToLower();
                text   = text.Substring(0, idx);
            }
            box.ItemsSource = AutoCompleteEmailNames.Where(s => s.StartsWith(domain)).Select(d => text + "@" + d).ToList();
        }
Esempio n. 22
0
        private async void dynamicSuggestBox_TextChanged(object sender, dotMorten.Xamarin.Forms.AutoSuggestBoxTextChangedEventArgs args)
        {
            AutoSuggestBox box = (AutoSuggestBox)sender;

            // Only get results when it was a user typing,
            // otherwise assume the value got filled in by TextMemberPath
            // or the handler for SuggestionChosen.
            if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            {
                if (string.IsNullOrWhiteSpace(box.Text) || box.Text.Length < 3)
                {
                    box.ItemsSource = null;
                }
                else
                {
                    var suggestions = await GetSuggestions(box.Text);

                    box.ItemsSource = suggestions.ToList();
                }
            }
        }
 private void AutoSuggestBox_TextChanged(object sender, XAutoSuggestBoxTextChangedEventArgs e)
 {
     MessagingCenter.Send(Element, "AutoSuggestBox_" + nameof(AutoSuggestBox.TextChanged), (Control.Text, (AutoSuggestionBoxTextChangeReason)e.Reason));
 }
 private void AutoSuggestBox_TextChanged(object sender, XAutoSuggestBoxTextChangedEventArgs e)
 {
     Element?.NativeControlTextChanged(Control.Text, (AutoSuggestionBoxTextChangeReason)e.Reason);
 }
Esempio n. 25
0
 private void NativeAutoSuggestBox_TextChanged(object sender, AutoSuggestBoxTextChangedEventArgs e)
 {
     Element.FireTextChanged(Control.Text, new AutoSuggestBoxTextChangedEventArgs(e.Reason));
 }