private void Spotify_MouseDown(object sender, MouseButtonEventArgs e) { MoreInfoIcon thumbnail = (MoreInfoIcon)sender; musicwindow.SongsTab.IsSelected = true; Navigation.NavigateTo(musicwindow); }
/* * DO NOT ALTER * */ void addFavourites() { try { foreach (MoreInfoIcon favourite in MovieLists.FavouriteMovieList) { MoreInfoIcon newThumbnail = new MoreInfoIcon(); MoreInfoIcon movies = new MoreInfoIcon(); newThumbnail.Icon.Source = favourite.Icon.Source; movies.Icon.Source = newThumbnail.Icon.Source; newThumbnail.ButtonLabel.Content = favourite.ButtonLabel.Content; movies.ButtonLabel.Content = newThumbnail.ButtonLabel.Content; newThumbnail.MouseDown += Thumbnail_MouseDown; movies.MouseDown += Thumbnail_MouseDown; newThumbnail.Description = favourite.Description; movies.Description = newThumbnail.Description; MovieElement.UniformGrid.Children.Add(newThumbnail); search.grid.Children.Add(movies); } } catch (Exception e2) { //do nothing } }
void AddService() { try { // Netlif default Uri uri = new Uri("pack://application:,,/HTPC_Project;component/Graphics/Hulu-UK-Unblock-and-Watch-Hulu-Plus-outside-USA.jpg", UriKind.RelativeOrAbsolute); BitmapImage img = new BitmapImage(uri); MoreInfoIcon app = new MoreInfoIcon(); MoreInfoIcon appsearch = new MoreInfoIcon(); app.Icon.Source = img; appsearch.Icon.Source = app.Icon.Source = img; app.ButtonLabel.Content = "Hulu"; appsearch.ButtonLabel.Content = app.ButtonLabel.Content = "Hulu"; app.MouseDown += Hulu_MouseDown; appsearch.MouseDown += Hulu_MouseDown; //MovieElement.UniformGrid.Children.Add(app); //MovieElement.UniformGrid.Children.RemoveAt(0); MovieElement.UniformGrid.Children.Insert(0, app); appsearch.Close.Visibility = Visibility.Collapsed; search.grid.Children.Add(appsearch); } catch (Exception e) { // Do nothing } }
private void MakeIcons() { string[] thumbnails = this.directories.Directories; foreach (string path in thumbnails) { string newPath = path + MainWindowContoller.POSTER; try { BitmapImage img = new BitmapImage(new Uri(newPath, UriKind.RelativeOrAbsolute)); MoreInfoIcon thumbnail = new MoreInfoIcon(); thumbnail.Close.Visibility = Visibility.Collapsed; this.Genre.Text = this.genreName; thumbnail.Icon.Source = img; thumbnail.Description = directories.LoadDescription(path + MainWindowContoller.DESCRIPTION); thumbnail.ButtonLabel.Content = directories.Title; // find the name of the file from the path // photoTile.ImageTitle.Text = path.Split('\\').Last().Split('.').First(); // Subscribe to the PhotoTile's MouseDown event // photoTile.MouseDown += new MouseButtonEventHandler(photoTile_MouseDown); // Add the PhotoTile to the PhotoViewerGrid // thumbnail.Close.Visibility thumbnail.MouseDown += Thumbnail_MouseDown; Movies.UniformGrid.Children.Add(thumbnail); } catch (Exception e) { } } }
private void Pictures_MouseDown(object sender, MouseButtonEventArgs e) { MoreInfoIcon thumbnail = (MoreInfoIcon)sender; picture.Photo.Source = thumbnail.Icon.Source; Navigation.NavigateTo(picture); }
void MakeIconsPictures() { // Retrieve the paths string[] thumbnails = this.photodirectory.Directories; picture.pictures = this.photodirectory.Directories; // For each path // Create a PhotoTile // add the image lead to by the path // add the title of the image // add the PhotoTile to the PhotoViewerGrid foreach (string path in thumbnails) { string newPath = path; try { // grab the image from the path // string newPath = path + POSTER; // Uri uri = new Uri(newPath); Uri uri = new Uri(newPath, UriKind.RelativeOrAbsolute); BitmapImage img = new BitmapImage(uri); //img.UriSource = new Uri(newPath, UriKind.RelativeOrAbsolute); MoreInfoIcon thumbnail = new MoreInfoIcon(); MoreInfoIcon pics = new MoreInfoIcon(); // set the source of the Image control to the image we got from the path thumbnail.Icon.Source = img; pics.Icon.Source = thumbnail.Icon.Source = img; thumbnail.ButtonLabel.Content = "Picture"; pics.ButtonLabel.Content = thumbnail.ButtonLabel.Content = "Picture"; // find the name of the file from the path // photoTile.ImageTitle.Text = path.Split('\\').Last().Split('.').First(); // Subscribe to the PhotoTile's MouseDown event // photoTile.MouseDown += new MouseButtonEventHandler(photoTile_MouseDown); // Add the PhotoTile to the PhotoViewerGrid thumbnail.MouseDown += Pictures_MouseDown; // picture.Photo.Source = thumbnail.Icon.Source; pics.MouseDown += Pictures_MouseDown; PictuesElement.UniformGrid.Children.Add(thumbnail); pics.Close.Visibility = Visibility.Collapsed; search.grid.Children.Add(pics); //Create Separate event handlers for every type } catch (Exception e) { // Do nothing } } }
private void Music_MouseDown(object sender, MouseButtonEventArgs e) { MusicPlayBack music = new MusicPlayBack(); MoreInfoIcon thumbnail = (MoreInfoIcon)sender; music.SongLabel.Source = thumbnail.Icon.Source; Navigation.NavigateTo(music); }
private void FavouriteButton_Click(object sender, RoutedEventArgs e) { MoreInfoIcon icon = new MoreInfoIcon(); icon.Icon.Source = MoviePoster.Source; icon.ButtonLabel.Content = this.title; icon.MouseDown += NewIcon_MouseDown; icon.Description = MovieDescription.Text; MovieLists.FavouriteMovieList.Add(icon); UnfavouriteButton.Visibility = Visibility.Visible; FavouriteButton.Visibility = Visibility.Collapsed; }
private void NewIcon_MouseDown(object sender, MouseButtonEventArgs e) { NetflixMain netflixMain = new NetflixMain(); MoreInfoIcon thumbnail = (MoreInfoIcon)sender; netflixMain.MoviePoster.Source = thumbnail.Icon.Source; netflixMain.MovieDescription.Text = thumbnail.Description; netflixMain.MoreLike.Text = "More Like: " + thumbnail.ButtonLabel.Content.ToString(); netflixMain.Title = thumbnail.ButtonLabel.Content.ToString(); string newTitle = netflixMain.Title; netflixMain.favouriteButtonCheck(); Navigation.NavigateTo(netflixMain); }
void MakeIcons() { // Retrieve the paths string[] thumbnails = this.directories.Directories; // For each path // Create a PhotoTile // add the image lead to by the path // add the title of the image // add the PhotoTile to the PhotoViewerGrid foreach (string path in thumbnails) { try { // grab the image from the path string newPath = path + POSTER; Uri uri = new Uri(newPath); BitmapImage img = new BitmapImage(uri); MoreInfoIcon thumbnail = new MoreInfoIcon(); // set the source of the Image control to the image we got from the path thumbnail.Icon.Source = img; thumbnail.Description = directories.LoadDescription(path + DESCRIPTION); thumbnail.ButtonLabel.Content = directories; thumbnail.MouseDown += Thumbnail_MouseDown; // find the name of the file from the path // photoTile.ImageTitle.Text = path.Split('\\').Last().Split('.').First(); // Subscribe to the PhotoTile's MouseDown event // photoTile.MouseDown += new MouseButtonEventHandler(photoTile_MouseDown); // Add the PhotoTile to the PhotoViewerGrid //MovieElement.UniformGrid.Children.Add(thumbnail); //Create Separate event handlers for every type } catch (Exception e) { // Do nothing } } }
/* * DO NOT ALTER * * */ private void Thumbnail_MouseDown(object sender, MouseButtonEventArgs e) { NetflixMain netflixMain = new NetflixMain(); MoviePlayBack playback = new MoviePlayBack(); MoreInfoIcon thumbnail = (MoreInfoIcon)sender; netflixMain.MoviePoster.Source = thumbnail.Icon.Source; netflixMain.MovieDescription.Text = thumbnail.Description; netflixMain.Title = thumbnail.ButtonLabel.Content.ToString(); netflixMain.MoreLike.Text = "More Like: " + thumbnail.ButtonLabel.Content.ToString(); netflixMain.favouriteButtonCheck(); playback.Movieplay.Source = thumbnail.Icon.Source; //netflixMain.Title = (sender as MoreInfoIcon).Title; //netflixMain.image.Source = (sender as MoreInfoIcon).Image.Source; Navigation.NavigateTo(netflixMain); }
public NetflixMain() { InitializeComponent(); string newTitle = title; foreach (MoreInfoIcon icon in MovieLists.ActionMovieList) { //Need to move description //Title under icons newIcon = new MoreInfoIcon(); newIcon.ButtonLabel.Content = icon.ButtonLabel.Content; newIcon.ButtonLabel.Foreground = System.Windows.Media.Brushes.White; newIcon.ButtonLabel.Opacity = 0.25; newIcon.Icon.Source = icon.Icon.Source; newIcon.VisualIndicator = icon.VisualIndicator; newIcon.Click = icon.Click; newIcon.Description = icon.Description; newIcon.Close.Visibility = Visibility.Collapsed; newIcon.MouseDown += NewIcon_MouseDown; Suggestions.Children.Add(newIcon); //MoreInfoIcon newIcon = icon; } UnfavouriteButton.Visibility = Visibility.Collapsed; FavouriteButton.Visibility = Visibility.Collapsed; /* { * FavouriteButton.Visibility = Visibility.Collapsed; * } * else * { * UnfavouriteButton.Visibility = Visibility.Collapsed; * }*/ // grid.Children.Add(topbar); }
/// <summary> /// Taken From PicturO (temporarily anyway) /// </summary> /// void makeDefaultbuttons() { try { // Netlif default Uri uri = new Uri("pack://application:,,/HTPC_Project;component/Graphics/netflix-logo.jpg", UriKind.RelativeOrAbsolute); BitmapImage img = new BitmapImage(uri); MoreInfoIcon netflixApp = new MoreInfoIcon(true); MoreInfoIcon searchNetflixApp = new MoreInfoIcon(); searchNetflixApp.Icon.Source = netflixApp.Icon.Source = img; searchNetflixApp.ButtonLabel.Content = netflixApp.ButtonLabel.Content = "Netflix"; netflixApp.MouseDown += Netflix_MouseDown; searchNetflixApp.MouseDown += Netflix_MouseDown; MovieElement.UniformGrid.Children.Add(netflixApp); searchNetflixApp.Close.Visibility = Visibility.Collapsed; search.grid.Children.Add(searchNetflixApp); // Spoti default Uri uri1 = new Uri("pack://application:,,/HTPC_Project;component/Graphics/spotify-logo.jpg", UriKind.RelativeOrAbsolute); BitmapImage img1 = new BitmapImage(uri1); MoreInfoIcon spotifyApp = new MoreInfoIcon(); MoreInfoIcon spotifyserch = new MoreInfoIcon(); spotifyApp.Icon.Source = img1; spotifyserch.Icon.Source = spotifyApp.Icon.Source = img1; spotifyApp.ButtonLabel.Content = "Spotify"; spotifyserch.ButtonLabel.Content = spotifyApp.ButtonLabel.Content = "Spotify"; spotifyApp.MouseDown += Spotify_MouseDown; spotifyserch.MouseDown += Spotify_MouseDown; SongsElement.UniformGrid.Children.Add(spotifyApp); spotifyserch.Close.Visibility = Visibility.Collapsed; search.grid.Children.Add(spotifyserch); // Playlist default Uri ur12 = new Uri("pack://application:,,/HTPC_Project;component/Graphics/playlist1.png", UriKind.RelativeOrAbsolute); BitmapImage img2 = new BitmapImage(ur12); MoreInfoIcon playlist = new MoreInfoIcon(); MoreInfoIcon playlistsearch = new MoreInfoIcon(); playlist.Icon.Source = img2; playlistsearch.Icon.Source = playlist.Icon.Source = img2; playlist.ButtonLabel.Content = "Playlist"; playlistsearch.ButtonLabel.Content = playlist.ButtonLabel.Content = "Playlist"; playlist.MouseDown += Playlist_MouseDown; playlistsearch.MouseDown += Playlist_MouseDown; SongsElement.UniformGrid.Children.Add(playlist); playlistsearch.Close.Visibility = Visibility.Collapsed; search.grid.Children.Add(playlistsearch); // Album default Uri uri3 = new Uri("pack://application:,,/HTPC_Project;component/Graphics/album3.png", UriKind.RelativeOrAbsolute); BitmapImage img3 = new BitmapImage(uri3); MoreInfoIcon album = new MoreInfoIcon(); MoreInfoIcon albumsearch = new MoreInfoIcon(); album.Icon.Source = img3; albumsearch.Icon.Source = album.Icon.Source = img3; album.ButtonLabel.Content = "Album"; albumsearch.ButtonLabel.Content = album.ButtonLabel.Content = "Album"; album.MouseDown += Album_MouseDown; albumsearch.MouseDown += Album_MouseDown; SongsElement.UniformGrid.Children.Add(album); albumsearch.Close.Visibility = Visibility.Collapsed; search.grid.Children.Add(albumsearch); } catch (Exception e) { // Do nothing } }