Пример #1
0
        public async void SearchTracks()
        {
            try
            {
                List <SoundCloudTrack> searchResult = await SoundCloudHelper.SearchTracks(TextToSearch, 50);

                Tracks.Clear();
                foreach (var result in searchResult)
                {
                    Tracks.Add(result);
                }
            }
            catch (Exception ex)
            {
                Logger.LogError(this, ex.Message);
                ShowErrorMessage("There was an error during searching tracks.");
            }
        }
Пример #2
0
        private async void SearchViewModel_SearchQueryChangedEvent()
        {
            try
            {
                if (textToSearch.Length > 2)
                {
                    SearchQuery.Clear();
                    List <SoundCloudTrack> searchResult = await SoundCloudHelper.SearchTracks(textToSearch, 50);

                    foreach (var result in searchResult)
                    {
                        SearchQuery.Add(result.title);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.LogError(this, ex.Message);
                ShowErrorMessage("There was an error during searching tracks.");
            }
        }