Ejemplo n.º 1
0
        public void OpenAlbum(AlbumCellViewModel cellVM)
        {
            var album = _databaseService.GetAlbum(cellVM.GUID);

            _navigationService.Navigate <AlbumVideosViewModel, VideoParameter>(new VideoParameter
            {
                Owner = album
            });
        }
Ejemplo n.º 2
0
        public void DeleteAlbum(AlbumCellViewModel cellVM)
        {
            var album = _databaseService.GetAlbum(cellVM.GUID);

            if (album != null)
            {
                _databaseService.DeleteAlbum(album);
            }

            Albums.Remove(cellVM);
        }
Ejemplo n.º 3
0
        public async override Task Initialize()
        {
            var albums = await _databaseService.GetAlbumsAsync();

            if (albums != null && albums.Any())
            {
                foreach (var album in albums)
                {
                    var cell = new AlbumCellViewModel
                    {
                        GUID = album.GUID,
                        Name = album.Title
                    };
                    cell.DeleteAction = () => DeleteAlbum(cell);
                    cell.OpenAction   = () => OpenAlbum(cell);
                    Albums.Add(cell);
                }
            }
        }
Ejemplo n.º 4
0
        public async Task CreateAlbum()
        {
            var result = await _dialogService.AskToAddAlbum();

            if (result.IsOk)
            {
                var newAlbum = new Album {
                    Title = result.Title
                };
                _databaseService.AddAlbum(newAlbum);
                var cell = new AlbumCellViewModel
                {
                    GUID = newAlbum.GUID,
                    Name = newAlbum.Title
                };
                cell.DeleteAction = () => DeleteAlbum(cell);
                cell.OpenAction   = () => OpenAlbum(cell);
                Albums.Add(cell);
            }
        }