Inheritance: VLC_WINRT.Common.AlwaysExecutableCommand
示例#1
0
 public void Dispose()
 {
     if (_vlcPlayerService != null)
     {
         _vlcPlayerService.StatusChanged -= PlayerStateChanged;
         _vlcPlayerService.Stop();
         _vlcPlayerService.Close();
         _vlcPlayerService = null;
     }
     _skipAhead = null;
     _skipBack = null;
 }
示例#2
0
        protected MediaPlaybackViewModel(HistoryService historyService, IMediaService mediaService, VlcService mediaPlayerService)
        {
            _historyService = historyService;

            _mediaService = mediaService;
            _mediaService.StatusChanged += PlayerStateChanged;

            _vlcPlayerService = mediaPlayerService;

            _displayAlwaysOnRequest = new DisplayRequest();
            _sliderPositionTimer = new DispatcherTimer();
            _sliderPositionTimer.Tick += FirePositionUpdate;
            _sliderPositionTimer.Interval = TimeSpan.FromMilliseconds(16);

            _skipAhead = new ActionCommand(() => _mediaService.SkipAhead());
            _skipBack = new ActionCommand(() => _mediaService.SkipBack());
            _playNext = new PlayNextCommand();
            _playPrevious = new PlayPreviousCommand();
            _playOrPause = new PlayPauseCommand();
            _goBackCommand = new StopVideoCommand();
        }
示例#3
0
        public MainPageViewModel()
        {
            LastViewedVM = new LastViewedViewModel();
            PickVideo = new PickVideoCommand();
            PlayNetworkMRL = new PlayNetworkMRLCommand();

            _toggleNetworkAppBarCommand =
                new ActionCommand(() => { IsNetworkAppBarShown = !IsNetworkAppBarShown; });

            _showAppBarCommand = new ActionCommand(() => { IsAppBarOpen = true; });

            // TODO: For Windows 8.1 build, use ResourceLoader.GetForCurrentView(); 

            var resourceLoader = new ResourceLoader();
            Panels.Add(new Panel(resourceLoader.GetString("Home"), 0, 1));
            Panels.Add(new Panel(resourceLoader.GetString("Videos"), 1, 0.4));
            Panels.Add(new Panel(resourceLoader.GetString("Music"), 2, 0.4));

            SecondaryPanels.Add(new Panel(resourceLoader.GetString("ExternalStorage"), 3, 0.4));
            SecondaryPanels.Add(new Panel(resourceLoader.GetString("MediaServers"), 4, 0.4));
            _setDefaultFolderForIndexingVideoCommand = new SelectDefaultFolderForIndexingVideoCommand();
            _goToPanelCommand = new GoToPanelCommand();
        }