Example #1
0
        private async void loadCompanies()
        {
            companyList = await StockNameLoad.getList();

            searchedList           = companyList;
            searchList.ItemsSource = companyList;
        }
Example #2
0
        //searchs the companies from a list activates every time user writes something in the modal window
        private async void searchCompanies(object sender, TextChangedEventArgs e)
        {
            searchText.Text = SearchBar.Text;
            searchedList    = new List <Company>();

            foreach (Company cmp in companyList)
            {
                if (cmp.symbol.IndexOf(searchText.Text.ToUpper()) != -1)
                {
                    searchedList.Add(cmp);
                }
            }

            if (searchedList.Count == 0)
            {
                searchedList = await StockNameLoad.getSearchList(searchText.Text.ToUpper());
            }

            searchList.ItemsSource = searchedList;
        }