From 17c1fd576057bdd2d6aea517d733fe8af6e6b2ba Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Sat, 23 Feb 2013 10:58:08 -0500 Subject: moved ui to it's own repo --- .../ViewModels/SpecialFeatureViewModel.cs | 135 --------------------- 1 file changed, 135 deletions(-) delete mode 100644 MediaBrowser.UI/ViewModels/SpecialFeatureViewModel.cs (limited to 'MediaBrowser.UI/ViewModels/SpecialFeatureViewModel.cs') diff --git a/MediaBrowser.UI/ViewModels/SpecialFeatureViewModel.cs b/MediaBrowser.UI/ViewModels/SpecialFeatureViewModel.cs deleted file mode 100644 index f6d51d6db..000000000 --- a/MediaBrowser.UI/ViewModels/SpecialFeatureViewModel.cs +++ /dev/null @@ -1,135 +0,0 @@ -using MediaBrowser.Model.Dto; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Net; -using System; -using System.Windows.Media.Imaging; - -namespace MediaBrowser.UI.ViewModels -{ - /// - /// Class SpecialFeatureViewModel - /// - public class SpecialFeatureViewModel : BaseViewModel - { - /// - /// Gets or sets the image download options. - /// - /// The image download options. - public ImageOptions ImageDownloadOptions { get; set; } - - /// - /// The _image width - /// - private double _imageWidth; - /// - /// Gets or sets the width of the image. - /// - /// The width of the image. - public double ImageWidth - { - get { return _imageWidth; } - - set - { - _imageWidth = value; - OnPropertyChanged("ImageWidth"); - } - } - - /// - /// The _image height - /// - private double _imageHeight; - /// - /// Gets or sets the height of the image. - /// - /// The height of the image. - public double ImageHeight - { - get { return _imageHeight; } - - set - { - _imageHeight = value; - OnPropertyChanged("ImageHeight"); - } - } - - /// - /// The _item - /// - private BaseItemDto _item; - /// - /// Gets or sets the item. - /// - /// The item. - public BaseItemDto Item - { - get { return _item; } - - set - { - _item = value; - OnPropertyChanged("Item"); - OnItemChanged(); - } - } - - /// - /// Gets the time string. - /// - /// The time string. - public string MinutesString - { - get - { - var time = TimeSpan.FromTicks(Item.RunTimeTicks ?? 0); - - var minutes = Math.Round(time.TotalMinutes); - - if (minutes <= 1) - { - return "1 minute"; - } - - return string.Format("{0} minutes", minutes); - } - } - - /// - /// The _image - /// - private BitmapImage _image; - /// - /// Gets the image. - /// - /// The image. - public BitmapImage Image - { - get { return _image; } - set - { - _image = value; - OnPropertyChanged("Image"); - } - } - - /// - /// Called when [item changed]. - /// - private async void OnItemChanged() - { - var options = ImageDownloadOptions ?? new ImageOptions { }; - - options.ImageType = ImageType.Primary; - - try - { - Image = await App.Instance.GetRemoteBitmapAsync(App.Instance.ApiClient.GetImageUrl(Item, options)); - } - catch (HttpException) - { - } - } - } -} -- cgit v1.2.3