示例#1
0
        public AlbumDetailViewModel(AlbumRepository albumRepository, IMessenger messenger)
        {
            this.albumRepository = albumRepository;
            this.messenger       = messenger;

            SaveAlbumCommand   = new SaveAlbumCommand(albumRepository, this, messenger);
            DeleteAlbumCommand = new RelayCommand(DeleteAlbum);

            this.messenger.Register <SelectedAlbumMessage>(SelectedAlbum);
            this.messenger.Register <NewMessage>(NewAlbumMessageReceived);
        }
示例#2
0
        public AlbumDetailViewModel(AlbumRepository albumRepository, IMessenger messenger)
        {
            this.albumRepository = albumRepository;
            this.messenger       = messenger;

            SaveAlbumCommand   = new SaveAlbumCommand(albumRepository, this, messenger);
            DeleteAlbumCommand = new RelayCommand(DeleteAlbum);

            ShowPhotoDetailCommand = new RelayCommand(ShowPhotoDetail);
            DetailPhotoCommand     = new RelayCommand(DetailPhotoView);
            NewPhotoCommand        = new NewPhotoCommand(albumRepository, this, messenger);
            EditPhotoCommand       = new RelayCommand(EditPhoto);
            DeletePhotoCommand     = new RelayCommand(DeletePhoto);

            this.messenger.Register <SelectedAlbumMessage>(SelectedAlbum);
            this.messenger.Register <NewAlbumMessage>(NewAlbumMessageRecieved);
            this.messenger.Register <SelectedPhotoInAlbumViewMessage>(SelectedPhoto);
        }