/// <summary>
        /// Initializes a new instance of the PlaylistViewModel class.
        /// </summary>
        public NowPlayingViewModel(INavigationService navigationService, IConnectionManager connectionManager, IStorageService storageService)
            :base (navigationService, connectionManager)
        {
            _playlistChecker = new DispatcherTimer { Interval = new TimeSpan(0, 0, 3) };
            _playlistChecker.Tick += PlaylistCheckerOnTick;

            Playlist = new ObservableCollection<PlaylistItem>();
            SelectedItems = new List<PlaylistItem>();
            if (IsInDesignMode)
            {
                Playlist = new ObservableCollection<PlaylistItem>
                {
                    new PlaylistItem {Artist = "John Williams", Album = "Jurassic Park OST", Id = 1, IsPlaying = true, TrackName = "Jurassic Park Theme"},
                    new PlaylistItem {Artist = "John Williams", Album = "Jurassic Park OST", Id = 2, IsPlaying = false, TrackName = "Journey to the Island"},
                    new PlaylistItem {Artist = "John Williams", Album = "Jurassic Park OST", Id = 10, IsPlaying = false, TrackName = "Incident at Isla Nublar"}
                };
                NowPlayingItem = Playlist[0];
            }
            else
            {
                _playlistHelper = new PlaylistHelper(storageService);
                BackgroundAudioPlayer.Instance.PlayStateChanged += OnPlayStateChanged;
                GetPlaylistItems();
                IsPlaying = BackgroundAudioPlayer.Instance.PlayerState == PlayState.Playing;
            }
        }
        /// <summary>
        /// Initializes a new instance of the PushViewModel class.
        /// </summary>
        public SettingsViewModel(IConnectionManager connectionManager, INavigationService navigationService, IApplicationSettingsService applicationSettings, IMessageBoxService messageBox)
            : base(navigationService, connectionManager)
        {
            _applicationSettings = applicationSettings.Legacy;
            _messageBox = messageBox;

            if (IsInDesignMode)
            {
                FoundServers = new ObservableCollection<ServerInfo>
                {
                    new ServerInfo{Id = Guid.NewGuid().ToString(), Name = "Home", LocalAddress = "http://192.168.0.2:8096"}
                };
            }
            else
            {
                LoadingFromSettings = true;
                SendTileUpdates = SendToastUpdates = true;
                RegisteredText = AppResources.DeviceNotRegistered;
                LoadingFromSettings = false;

                SetStreamingQuality();

                _ignoreRunUnderLockChanged = true;
                RunUnderLock = App.SpecificSettings.PlayVideosUnderLock;
                _ignoreRunUnderLockChanged = false;
            }
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the MovieViewModel class.
 /// </summary>
 public MovieViewModel(INavigationService navigationService, IConnectionManager connectionManager)
     : base(navigationService, connectionManager)
 {
     CanUpdateFavourites = true;
     if (IsInDesignMode)
     {
         SelectedMovie = new BaseItemDto
         {
             Id = "6536a66e10417d69105bae71d41a6e6f",
             Name = "Jurassic Park",
             SortName = "Jurassic Park",
             Overview = "Lots of dinosaurs eating people!",
             People = new[]
             {
                 new BaseItemPerson {Name = "Steven Spielberg", Type = "Director"},
                 new BaseItemPerson {Name = "Sam Neill", Type = "Actor"},
                 new BaseItemPerson {Name = "Richard Attenborough", Type = "Actor"},
                 new BaseItemPerson {Name = "Laura Dern", Type = "Actor"}
             }
         };
     }
     else
     {
         WireCommands();
     }
 }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the TvViewModel class.
        /// </summary>
        public TvViewModel(INavigationService navigationService, IConnectionManager connectionManager, IMessageBoxService messageBox) 
            : base(navigationService, connectionManager)
        {
            _messageBox = messageBox;
            RecentItems = new ObservableCollection<BaseItemDto>();
            Episodes = new List<BaseItemDto>();
            CanUpdateFavourites = true;
            if (IsInDesignMode)
            {
                SelectedTvSeries = new BaseItemDto
                {
                    Name = "Scrubs"
                };
                SelectedSeason = new BaseItemDto
                {
                    Name = "Season 1"
                };
                Episodes = new[]
                {
                    new BaseItemDto
                    {
                        Id = "e252ea3059d140a0274282bc8cd194cc",
                        Name = "1x01 - Pilot",
                        Overview =
                            "A Kindergarten teacher starts speaking gibberish and passed out in front of her class. What looks like a possible brain tumor does not respond to treatment and provides many more questions than answers for House and his team as they engage in a risky trial-and-error approach to her case. When the young teacher refuses any additional variations of treatment and her life starts slipping away, House must act against his code of conduct and make a personal visit to his patient to convince her to trust him one last time."
                    }
                }.ToList();
                SelectedEpisode = Episodes[0];

            }
            else
            {
                WireCommands();
            }
        }
 /// <summary>
 /// Initializes a new instance of the ChooseProfileViewModel class.
 /// </summary>
 public ChooseProfileViewModel(IConnectionManager connectionManager, INavigationService navigationService)
     : base(navigationService, connectionManager)
 {
     Profiles = new ObservableCollection<UserDto>();
     if (IsInDesignMode)
     {
         Profiles = new ObservableCollection<UserDto>
         {
             new UserDto
             {
                 Id = new Guid("dd425709431649698e92d86b1f2b00fa").ToString(),
                 Name = "ScottIsAFool"
             },
             new UserDto
             {
                 Id = new Guid("dab28e40cfbc43658082f55a44cf139a").ToString(),
                 Name = "Redshirt",
                 LastLoginDate = DateTime.Now.AddHours(-1)
             }
         };
     }
     else
     {
         WireCommands();
     }
 }
 /// <summary>
 /// Initializes a new instance of the RemoteViewModel class.
 /// </summary>
 public RemoteViewModel(INavigationService navigationService, IConnectionManager connectionManager)
     : base(navigationService, connectionManager)
 {
     if (IsInDesignMode)
     {
         Clients = new List<SessionInfoDto>
         {
             new SessionInfoDto
             {
                 Client = "Dashboard"
             }
         };
     }
 }
 /// <summary>
 /// Initializes a new instance of the PhotoUploadViewModel class.
 /// </summary>
 public PhotoUploadViewModel(INavigationService navigationService, IConnectionManager connectionManager, IApplicationSettingsService appSettingsService)
     : base(navigationService, connectionManager)
 {
     _appSettingsService = appSettingsService.Legacy;
     if (IsInDesignMode)
     {
         IsPhotoUploadsEnabled = true;
     }
     else
     {
         _ignoreChange = true;
         IsPhotoUploadsEnabled = App.UploadSettings.IsPhotoUploadsEnabled;
         UploadAll = App.UploadSettings.UploadAllPhotos;
         AfterDateTime = App.UploadSettings.UploadAfterDateTime;
         _ignoreChange = false;
     }
 }
Пример #8
0
        /// <summary>
        /// Initializes a new instance of the MusicViewModel class.
        /// </summary>
        public MusicViewModel(IConnectionManager connectionManager, INavigationService navigationService)
            : base(navigationService, connectionManager)
        {
            SelectedTracks = new List<BaseItemDto>();
            CanUpdateFavourites = true;
            if (IsInDesignMode)
            {
                SelectedArtist = new BaseItemDto
                {
                    Name = "Hans Zimmer",
                    Id = "179d32421632781047c73c9bd501adea"
                };
                SelectedAlbum = new BaseItemDto
                {
                    Name = "The Dark Knight Rises",
                    Id = "f8d5c8cbcbd39bc75c2ba7ada65d4319",
                };
                Albums = new ObservableCollection<BaseItemDto>
                {
                    new BaseItemDto {Name = "The Dark Knight Rises", Id = "f8d5c8cbcbd39bc75c2ba7ada65d4319", ProductionYear = 2012},
                    new BaseItemDto {Name = "Batman Begins", Id = "03b6dbb15e4abcca6ee336a2edd79ba6", ProductionYear = 2005},
                    new BaseItemDto {Name = "Sherlock Holmes", Id = "6e2d519b958d440d034c3ba6eca008a4", ProductionYear = 2010}
                };
                AlbumTracks = new List<BaseItemDto>
                {
                    new BaseItemDto {Name = "Bombers Over Ibiza (Junkie XL Remix)", IndexNumber = 1, ParentIndexNumber = 2, RunTimeTicks = 3487920000, Id = "7589bfbe8b10d0191e305d92f127bd01"},
                    new BaseItemDto {Name = "A Storm Is Coming", Id = "1ea1fd991c70b33c596611dadf24defc", IndexNumber = 1, ParentIndexNumber = 1, RunTimeTicks = 369630000},
                    new BaseItemDto {Name = "On Thin Ice", Id = "2696da6a01f254fbd7e199a191bd5c4f", IndexNumber = 2, ParentIndexNumber = 1, RunTimeTicks = 1745500000},
                }.OrderBy(x => x.ParentIndexNumber)
                    .ThenBy(x => x.IndexNumber).ToList();

                SortedTracks = Utils.GroupItemsByName(AlbumTracks).Result;
            }
            else
            {
                WireCommands();
            }
        }
 /// <summary>
 /// Initializes a new instance of the AllProgrammesViewModel class.
 /// </summary>
 public AllProgrammesViewModel(INavigationService navigationService, IConnectionManager connectionManager)
     : base(navigationService, connectionManager)
 {
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the LiveTvViewModel class.
 /// </summary>
 public LiveTvViewModel(INavigationService navigationService, IConnectionManager connectionManager)
     : base (navigationService, connectionManager)
 {
 }
 /// <summary>
 /// Initializes a new instance of the MbConnectViewModel class.
 /// </summary>
 public MbConnectViewModel(INavigationService navigationService, IConnectionManager connectionManager, IApplicationSettingsService appSettings)
     : base(navigationService, connectionManager)
 {
     _appSettings = appSettings.Legacy;
 }
 /// <summary>
 /// Initializes a new instance of the SplashscreenViewModel class.
 /// </summary>
 public SplashscreenViewModel(IConnectionManager connectionManager, INavigationService navigationService, IApplicationSettingsService applicationSettings)
     : base(navigationService, connectionManager)
 {
     _applicationSettings = applicationSettings.Legacy;
 }