musiclist.cs (2074B)
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 using Windows.UI.Xaml; 7 using Windows.UI.Xaml.Media; 8 9 namespace File360 10 { 11 class MusicList 12 { 13 14 public double ImageHeight 15 { 16 get 17 { 18 if (IsVertical()) return Window.Current.Bounds.Height / 3.5; 19 else return Window.Current.Bounds.Width / 3.5; 20 } 21 } 22 public double ImageWidth 23 { 24 get 25 { 26 if (IsVertical()) return Window.Current.Bounds.Width / 2.2; 27 else return Window.Current.Bounds.Height / 2.2; 28 } 29 } 30 31 public double PicHeight 32 { 33 get 34 { 35 if (IsVertical()) return (Window.Current.Bounds.Height) / 2.5; 36 else return (Window.Current.Bounds.Width) / 2.5; 37 } 38 } 39 public double PicWidth 40 { 41 get 42 { 43 if (IsVertical()) return Window.Current.Bounds.Width / 2; 44 else return Window.Current.Bounds.Height / 2; 45 } 46 } 47 public ImageBrush Background { set; get; } 48 public string SongName { set; get; } 49 public string ArtistName { set; get; } 50 public string AlbumName { set; get; } 51 public string Count{ set; get; } 52 public string FolderName { get; set; } 53 54 public MusicList(string songName, string artistName, string albumName, ImageBrush background) 55 { 56 this.SongName = songName; 57 this.ArtistName = artistName; 58 this.AlbumName = albumName; 59 this.Background = background; 60 } 61 62 public MusicList(string folderName, int count) 63 { 64 this.FolderName = folderName; 65 this.Count = count.ToString(); 66 } 67 68 69 private bool IsVertical() 70 { 71 if (Window.Current.Bounds.Height > Window.Current.Bounds.Width) return true; 72 else return false; 73 } 74 } 75 76 }