/// <summary>
        /// Initializes a new instance of the ChooseProfileViewModel class.
        /// </summary>
        public ChooseProfileViewModel(IExtendedApiClient apiClient, INavigationService navigationService, IApplicationSettingsService applicationSettings)
        {
            _apiClient = apiClient;
            _navigationService = navigationService;

            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 MainViewModel class.
        /// </summary>
        public MainViewModel(IExtendedApiClient apiClient, INavigationService navService)
        {
            _apiClient  = apiClient;
            _navService = navService;

            Folders        = new ObservableCollection <BaseItemDto>();
            RecentItems    = new ObservableCollection <BaseItemDto>();
            FavouriteItems = new ObservableCollection <BaseItemDto>();

            if (IsInDesignMode)
            {
                Folders.Add(new BaseItemDto {
                    Id = "78dbff5aa1c2101b98ebaf42b72a988d", Name = "Movies", RecursiveUnplayedItemCount = 6
                });
                RecentItems.Add(new BaseItemDto {
                    Id = "2fc6f321b5f8bbe842fcd0eed089561d", Name = "A Night To Remember"
                });
            }
            else
            {
                WireCommands();
                DummyFolder = new BaseItemDto
                {
                    Type = "folder",
                    Name = AppResources.Recent.ToLower()
                };
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the PlaylistViewModel class.
        /// </summary>
        public PlaylistViewModel(INavigationService navigationService, IStorageService storageService)
        {
            _navigationService = navigationService;
            _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 = 3, IsPlaying = false, TrackName = "Incident at Isla Nublar"
                    }
                };
                NowPlayingItem = Playlist[0];
            }
            else
            {
                _playlistHelper = new PlaylistHelper(storageService);
                BackgroundAudioPlayer.Instance.PlayStateChanged += OnPlayStateChanged;
            }
        }
        /// <summary>
        /// Initializes a new instance of the MovieViewModel class.
        /// </summary>
        public MovieViewModel(INavigationService navService, IExtendedApiClient apiClient)
        {
            _navService = navService;
            _apiClient = apiClient;

            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();
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Initializes a new instance of the ChooseProfileViewModel class.
        /// </summary>
        public ChooseProfileViewModel(IExtendedApiClient apiClient, INavigationService navigationService, IApplicationSettingsService applicationSettings)
        {
            _apiClient         = apiClient;
            _navigationService = navigationService;

            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 MusicViewModel class.
        /// </summary>
        public MusicViewModel(IExtendedApiClient apiClient, INavigationService navigationService)
        {
            _navigationService = navigationService;
            _apiClient         = apiClient;

            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 RemoteViewModel class.
        /// </summary>
        public RemoteViewModel(INavigationService navigationService, IExtendedApiClient apiClient)
        {
            _navigationService = navigationService;
            _apiClient         = apiClient;

            if (IsInDesignMode)
            {
                Clients = new List <SessionInfoDto>
                {
                    new SessionInfoDto
                    {
                        Client = "Dashboard"
                    }
                };
            }
        }
        /// <summary>
        /// Initializes a new instance of the RemoteViewModel class.
        /// </summary>
        public RemoteViewModel(INavigationService navigationService, IExtendedApiClient apiClient)
        {
            _navigationService = navigationService;
            _apiClient = apiClient;

            if (IsInDesignMode)
            {
                Clients = new List<SessionInfoDto>
                {
                    new SessionInfoDto
                    {
                        Client = "Dashboard"
                    }
                };
            }
        }
        /// <summary>
        /// Initializes a new instance of the MusicViewModel class.
        /// </summary>
        public MusicViewModel(IExtendedApiClient apiClient, INavigationService navigationService)
        {
            _navigationService = navigationService;
            _apiClient = apiClient;

            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 PlaylistViewModel class.
        /// </summary>
        public PlaylistViewModel(INavigationService navigationService, IStorageService storageService)
        {
            _navigationService = navigationService;
            _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 = 3, IsPlaying = false, TrackName = "Incident at Isla Nublar"}
                };
                NowPlayingItem = Playlist[0];
            }
            else
            {
                _playlistHelper = new PlaylistHelper(storageService);
                BackgroundAudioPlayer.Instance.PlayStateChanged += OnPlayStateChanged;
            }
        }
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(IExtendedApiClient apiClient, INavigationService navService)
        {
            _apiClient = apiClient;
            _navService = navService;

            Folders = new ObservableCollection<BaseItemDto>();
            RecentItems = new ObservableCollection<BaseItemDto>();
            FavouriteItems = new ObservableCollection<BaseItemDto>();

            if (IsInDesignMode)
            {
                Folders.Add(new BaseItemDto {Id = "78dbff5aa1c2101b98ebaf42b72a988d", Name = "Movies", RecursiveUnplayedItemCount = 6});
                RecentItems.Add(new BaseItemDto {Id = "2fc6f321b5f8bbe842fcd0eed089561d", Name = "A Night To Remember"});
            }
            else
            {
                WireCommands();
                DummyFolder = new BaseItemDto
                {
                    Type = "folder",
                    Name = AppResources.Recent.ToLower()
                };
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Initializes a new instance of the MovieViewModel class.
        /// </summary>
        public MovieViewModel(INavigationService navService, IExtendedApiClient apiClient)
        {
            _navService = navService;
            _apiClient  = apiClient;

            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();
            }
        }
 /// <summary>
 /// Initializes a new instance of the SplashscreenViewModel class.
 /// </summary>
 public SplashscreenViewModel(IExtendedApiClient apiClient, INavigationService navigationService, IApplicationSettingsService applicationSettings)
 {
     _apiClient = apiClient;
     _navigationService = navigationService;
     _applicationSettings = applicationSettings;
 }
 /// <summary>
 /// Initializes a new instance of the SplashscreenViewModel class.
 /// </summary>
 public SplashscreenViewModel(IExtendedApiClient apiClient, INavigationService navigationService, IApplicationSettingsService applicationSettings)
 {
     _apiClient           = apiClient;
     _navigationService   = navigationService;
     _applicationSettings = applicationSettings;
 }