/Application/GUI/Controls/TrayToolTip.xaml.cs

http://yet-another-music-application.googlecode.com/ · 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. using System;
  19. using System.Collections.Generic;
  20. using System.Linq;
  21. using System.IO;
  22. using System.Text;
  23. using System.Windows;
  24. using System.Windows.Controls;
  25. using System.Windows.Data;
  26. using System.Windows.Documents;
  27. using System.Windows.Input;
  28. using System.Windows.Media;
  29. using System.Windows.Media.Imaging;
  30. using System.Windows.Navigation;
  31. using System.Windows.Shapes;
  32. namespace Stoffi
  33. {
  34. /// <summary>
  35. /// Interaction logic for TrayToolTip.xaml
  36. /// </summary>
  37. public partial class TrayToolTip : UserControl
  38. {
  39. public StoffiWindow ParentWindow;
  40. public TrayToolTip(StoffiWindow parent)
  41. {
  42. ParentWindow = parent;
  43. U.L(LogLevel.Debug, "TRAY TOOLTIP", "Initialize");
  44. InitializeComponent();
  45. U.L(LogLevel.Debug, "TRAY TOOLTIP", "Initialized");
  46. }
  47. public void SetTrack(TrackData track)
  48. {
  49. TrackArtist.Text = track.Artist;
  50. TrackTitle.Text = track.Title;
  51. AlbumArt.Source = FilesystemManager.GetImageTag(track);
  52. }
  53. public void Clear()
  54. {
  55. TrackArtist.Text = "";
  56. TrackTitle.Text = "Nothing is playing";
  57. AlbumArt.Source = new BitmapImage(new Uri("/GUI/Images/AlbumArt/Default.jpg", UriKind.RelativeOrAbsolute));
  58. }
  59. }
  60. }