private void AutoTextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (string.IsNullOrEmpty(this.SearchBox.Text))
            {
                this.CloseAutoSuggestionBox();
                this.autoList.ItemsSource = this.AutoSuggestionList.Where(p => p.Contains(this.SearchBox.Text, StringComparison.OrdinalIgnoreCase)).ToList();
                Movies.LoadPopularMovies();
                MovieDisplay.MovieDisplayUserControl.Page  = 0;
                MovieDisplay.MovieDisplayUserControl.Index = 0;
                MovieDisplay.Refresh();
                return;
            }

            if (!(e.Changes.Where(c => c.RemovedLength > 0).Count() > 0))
            {
                if (this.SearchBox.Text != Helper.Message.SearchBoxText)
                {
                    this.OpenAutoSuggestionBox();
                    this.autoList.ItemsSource = this.AutoSuggestionList.Where(p => p.Contains(this.SearchBox.Text, StringComparison.OrdinalIgnoreCase)).ToList();
                    Movies.SearchMovie(SearchBox.Text);
                    MovieDisplay.MovieDisplayUserControl.Page  = 0;
                    MovieDisplay.MovieDisplayUserControl.Index = 0;
                    MovieDisplay.Refresh();
                }
            }
        }
Exemplo n.º 2
0
        public void HomePage()
        {
            LoginDropDown.Visibility    = Visibility.Hidden;
            StartPage.Visibility        = Visibility.Visible;
            RegistrationPage.Visibility = Visibility.Hidden;
            UserPage.Visibility         = Visibility.Hidden;
            AboutPage.Visibility        = Visibility.Hidden;

            Movies.LoadNewMovies();

            MovieDisplay.MovieDisplayUserControl.Page  = 0;
            MovieDisplay.MovieDisplayUserControl.Index = 0;
            MovieDisplay.Refresh();
        }
Exemplo n.º 3
0
        public MovieDisplay()
        {
            if (MovieDisplayUserControl != null)
            {
                throw new NotSupportedException();
            }

            MovieDisplayUserControl = this;

            InitializeComponent();

            InitializeMovieView();

            DataContext = this;
        }
Exemplo n.º 4
0
        public void HomePage(string moviedisplay)
        {
            LoginDropDown.Visibility = Visibility.Hidden;
            StartPage.Visibility     = Visibility.Visible;

            RegistrationPage.Visibility = Visibility.Hidden;
            UserPage.Visibility         = Visibility.Hidden;
            AboutPage.Visibility        = Visibility.Hidden;

            switch (moviedisplay)
            {
            case "genre": Movies.LoadMoviesByGenre(GenresComboBox.Text); break;

            case "rating": Movies.LoadPopularMovies(); break;
            }

            MovieDisplay.MovieDisplayUserControl.Page  = 0;
            MovieDisplay.MovieDisplayUserControl.Index = 0;
            MovieDisplay.Refresh();
        }