sdlist.cs (4534B)
1 using System; 2 using System.Collections.ObjectModel; 3 using Windows.Foundation; 4 using Windows.Storage.FileProperties; 5 using Windows.UI.Xaml; 6 using Windows.UI.Xaml.Data; 7 using Windows.UI.Xaml.Media; 8 using Windows.UI.Xaml.Media.Imaging; 9 namespace File360 10 { 11 public class sdlist 12 { 13 public ImageBrush Background { set; get; } 14 15 public double BarHeight 16 { 17 get 18 { 19 if (IsVertical()) return Window.Current.Bounds.Height / 7.3; 20 else return Window.Current.Bounds.Width / 7.3; 21 } 22 } 23 24 25 26 public double PopupHeight 27 { 28 get 29 { 30 if (IsVertical()) return Window.Current.Bounds.Height / 2; 31 else return Window.Current.Bounds.Width / 2; 32 } 33 } 34 35 public string Name { set; get; } 36 37 public string Image { set; get; } 38 39 public string Count { set; get; } 40 41 public bool IsVisible { set; get; } 42 43 44 public double VidHeight 45 { 46 get 47 { 48 if (IsVertical()) return Window.Current.Bounds.Height / 4; 49 else return Window.Current.Bounds.Width / 4; 50 } 51 } 52 public double VidWidth 53 { 54 get 55 { 56 if (IsVertical()) return Window.Current.Bounds.Width / 0.95; 57 else return Window.Current.Bounds.Height / 0.95; 58 } 59 } 60 61 public double PicHeight 62 { 63 get 64 { 65 if (IsVertical()) return (Window.Current.Bounds.Height - 20) / 3; 66 else return (Window.Current.Bounds.Width -20) / 3; 67 } 68 } 69 public double PicWidth 70 { 71 get 72 { 73 if (IsVertical()) return Window.Current.Bounds.Width / 2; 74 else return Window.Current.Bounds.Height / 2; 75 } 76 } 77 public double ImageHeight 78 { 79 get 80 { 81 if (IsVertical()) return Window.Current.Bounds.Height / 3.5; 82 else return Window.Current.Bounds.Width / 3.5; 83 } 84 } 85 public double ImageWidth 86 { 87 get 88 { 89 if (IsVertical()) return Window.Current.Bounds.Width / 2.2; 90 else return Window.Current.Bounds.Height / 2.2; 91 } 92 } 93 public double Space 94 { 95 get { return Window.Current.Bounds.Height / 600; } 96 } 97 public double GridHeight 98 { 99 get 100 { 101 if (IsVertical()) return Window.Current.Bounds.Height / 6; 102 else return Window.Current.Bounds.Width / 6; 103 } 104 } 105 public double GridWidth 106 { 107 get 108 { 109 if (IsVertical()) return (Window.Current.Bounds.Width ) / 3; 110 else return (Window.Current.Bounds.Height) / 3; 111 } 112 } 113 public double ListHeight 114 { 115 get 116 { 117 if (IsVertical()) return Window.Current.Bounds.Height / 8; 118 else return Window.Current.Bounds.Width / 8; 119 } 120 } 121 public double Width 122 { 123 get { return Window.Current.Bounds.Width; } 124 } 125 126 127 public sdlist(string name, string image) 128 { 129 this.Name = name; 130 this.Image = image; 131 if (image == "f") IsVisible = false; 132 else IsVisible = true; 133 } 134 135 public sdlist(string name, string image, string count) 136 { 137 this.Name = name; 138 this.Image = image; 139 this.Count = count; 140 } 141 public sdlist(string name, StorageItemThumbnail background, string count) 142 { 143 ImageBrush im = new ImageBrush(); 144 BitmapImage bm = new BitmapImage(); 145 bm.SetSource(background); 146 im.ImageSource = bm; 147 im.Stretch = Stretch.UniformToFill; 148 this.Name = name; 149 this.Background = im; 150 this.Count = count; 151 } 152 public sdlist(string name, ImageBrush background, string count) 153 { 154 this.Name = name; 155 this.Background = background; 156 this.Count = count; 157 } 158 private bool IsVertical() 159 { 160 if (Window.Current.Bounds.Height > Window.Current.Bounds.Width) return true; 161 else return false; 162 } 163 } 164 } 165 166