Exemplo n.º 1
0
        private async void AppBarButton_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(FilmSearchBox.Text))
            {
                FilmSearchBox.IsEnabled = false;
                try
                {
                    switch (await ViewModel.RechercheFilm())
                    {
                    case 0:
                        await MessageBox.ShowAsync(ResourceLoader.GetForCurrentView().GetString("AucunResultat"));

                        break;

                    case 2:
                        if (ViewModel.Film.Type == (int)TypeFilmEnum.FILM || ViewModel.Film.Type == (int)TypeFilmEnum.DOCUMENTAIRE || ViewModel.Film.Type == (int)TypeFilmEnum.SPECTACLE || ViewModel.Film.Type == (int)TypeFilmEnum.ANIMATION)
                        {
                            await DlgChoixFilm.ShowAsync();
                        }

                        if (ViewModel.Film.Type == (int)TypeFilmEnum.SERIE)
                        {
                            await DlgChoixSerie.ShowAsync();
                        }
                        break;
                    }
                }
                catch (Exception)
                {
                    await MessageBox.ShowAsync(ResourceLoader.GetForCurrentView().GetString("erreurInternet"));
                }
                FilmSearchBox.IsEnabled = true;
            }
        }
Exemplo n.º 2
0
        private async void AutoSuggestBox_OnQuerySubmitted(AutoSuggestBox sender, AutoSuggestBoxQuerySubmittedEventArgs args)
        {
            if (!string.IsNullOrEmpty(args.QueryText))
            {
                FilmSearchBox.IsEnabled = false;
                try
                {
                    switch (await ViewModel.RechercheFilm())
                    {
                    case 0:
                        await MessageBox.ShowAsync(ResourceLoader.GetForCurrentView().GetString("AucunResultat"));

                        break;

                    case 2:
                        if (ViewModel.Film.Type == (int)TypeFilmEnum.FILM)
                        {
                            await DlgChoixFilm.ShowAsync();
                        }

                        if (ViewModel.Film.Type == (int)TypeFilmEnum.SERIE)
                        {
                            await DlgChoixSerie.ShowAsync();
                        }
                        break;
                    }
                }
                catch (Exception)
                {
                    await MessageBox.ShowAsync(ResourceLoader.GetForCurrentView().GetString("erreurInternet"));
                }
                FilmSearchBox.IsEnabled = true;
            }
        }
Exemplo n.º 3
0
        private async void FindMovie_Click(object sender, RoutedEventArgs e)
        {
            var id = (int)((AppBarButton)sender).Tag;

            if (await ViewModel.LoadDlg(id))
            {
                await DlgChoixFilm.ShowAsync();
            }
        }
Exemplo n.º 4
0
        private async void SelectFilmDlg(object sender, ItemClickEventArgs e)
        {
            try
            {
                var film = e.ClickedItem as ResultSearchMovieJson;
                await ViewModel.SelectMovieFmDlg(film.id);

                DlgChoixFilm.Hide();
            }
            catch (Exception)
            {
                await MessageBox.ShowAsync(ResourceLoader.GetForCurrentView().GetString("erreurInternet"));
            }
        }