/Application/GUI/Controls/TrayToolTip.xaml.cs
C# | 64 lines | 40 code | 4 blank | 20 comment | 0 complexity | 872a3bcf5f54342465798bc8a9845395 MD5 | raw file
1/** 2 * TrayToolTip.xaml.cs 3 * 4 * The tooltip that is shown when the tray icon is hovered. 5 * 6 * * * * * * * * * 7 * 8 * This code is part of the Stoffi Music Player Project. 9 * Visit our website at: stoffiplayer.com 10 * 11 * This program is free software; you can redistribute it and/or 12 * modify it under the terms of the GNU General Public License 13 * as published by the Free Software Foundation; either version 14 * 3 of the License, or (at your option) any later version. 15 * 16 * See stoffiplayer.com/license for more information. 17 **/ 18 19using System; 20using System.Collections.Generic; 21using System.Linq; 22using System.IO; 23using System.Text; 24using System.Windows; 25using System.Windows.Controls; 26using System.Windows.Data; 27using System.Windows.Documents; 28using System.Windows.Input; 29using System.Windows.Media; 30using System.Windows.Media.Imaging; 31using System.Windows.Navigation; 32using System.Windows.Shapes; 33 34namespace Stoffi 35{ 36 /// <summary> 37 /// Interaction logic for TrayToolTip.xaml 38 /// </summary> 39 public partial class TrayToolTip : UserControl 40 { 41 public StoffiWindow ParentWindow; 42 public TrayToolTip(StoffiWindow parent) 43 { 44 ParentWindow = parent; 45 U.L(LogLevel.Debug, "TRAY TOOLTIP", "Initialize"); 46 InitializeComponent(); 47 U.L(LogLevel.Debug, "TRAY TOOLTIP", "Initialized"); 48 } 49 50 public void SetTrack(TrackData track) 51 { 52 TrackArtist.Text = track.Artist; 53 TrackTitle.Text = track.Title; 54 AlbumArt.Source = FilesystemManager.GetImageTag(track); 55 } 56 57 public void Clear() 58 { 59 TrackArtist.Text = ""; 60 TrackTitle.Text = "Nothing is playing"; 61 AlbumArt.Source = new BitmapImage(new Uri("/GUI/Images/AlbumArt/Default.jpg", UriKind.RelativeOrAbsolute)); 62 } 63 } 64}