コード例 #1
0
        public FullMediaViewModel(
            MusicViewModel <IInputPeer> music,
            FilesViewModel <IInputPeer> files,
            LinksViewModel <IInputPeer> links,
            MediaViewModel <IInputPeer> media,
            IStateService stateService,
            INavigationService navigationService)
        {
            //tombstoning
            if (stateService.CurrentInputPeer == null)
            {
                ShellViewModel.Navigate(navigationService);
                return;
            }

            CurrentItem = stateService.CurrentInputPeer;
            stateService.CurrentInputPeer = null;

            ImageViewer = new ImageViewerViewModel(stateService, IoC.Get <IVideoFileManager>(), true);

            Media                        = media;
            Media.ImageViewer            = ImageViewer;
            Files                        = files;
            Files.SetSelectedCountAction = SetSelectedCount;
            Files.PropertyChanged       += OnFilesPropertyChanged;
            Links                        = links;
            Links.SetSelectedCountAction = SetSelectedCount;
            Links.PropertyChanged       += OnLinksPropertyChanged;
            Music                        = music;
            Music.SetSelectedCountAction = SetSelectedCount;
            Music.PropertyChanged       += OnMusicPropertyChanged;
            _stateService                = stateService;
        }
コード例 #2
0
        public FullMediaViewModel(
            MusicViewModel <IInputPeer> music,
            FilesViewModel <IInputPeer> files,
            LinksViewModel <IInputPeer> links,
            MediaViewModel <IInputPeer> media,
            IStateService stateService,
            INavigationService navigationService)
        {
            //tombstoning
            if (stateService.CurrentInputPeer == null)
            {
                stateService.ClearNavigationStack = true;
                navigationService.UriFor <ShellViewModel>().Navigate();
                return;
            }

            CurrentItem = stateService.CurrentInputPeer;
            stateService.CurrentInputPeer = null;

            ImageViewer = new ImageViewerViewModel(stateService, IoC.Get <IVideoFileManager>());

            Media                  = media;
            Media.ImageViewer      = ImageViewer;
            Files                  = files;
            Files.PropertyChanged += OnFilesPropertyChanged;
            Links                  = links;
            Links.PropertyChanged += OnLinksPropertyChanged;
            Music                  = music;
            Music.PropertyChanged += OnMusicPropertyChanged;
            _stateService          = stateService;
        }