Esempio n. 1
0
        void VideoView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (e.OldValue is VideoViewModel)
            {
                timeLineSlider.RemoveHandler(Slider.MouseLeftButtonDownEvent, new MouseButtonEventHandler(timeLineSlider_MouseLeftButtonDownEvent));
                timeLineSlider.RemoveHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(timeLineSlider_MouseLeftButtonUpEvent));

                VideoViewModel viewModel = e.OldValue as VideoViewModel;

                videoPlayer.DoubleClick   -= videoPlayer_DoubleClick;
                viewModel.PropertyChanged -= videoPlayerViewModel_PropertyChanged;

                viewModel.Dispose();
            }

            if (e.NewValue is VideoViewModel)
            {
                VideoViewModel viewModel = e.NewValue as VideoViewModel;

                viewModel.initializeVideoPlayer(videoPlayer.ViewModel);

                videoPlayer.DoubleClick   += videoPlayer_DoubleClick;
                viewModel.PropertyChanged += videoPlayerViewModel_PropertyChanged;

                timeLineSlider.AddHandler(Slider.MouseLeftButtonDownEvent, new MouseButtonEventHandler(timeLineSlider_MouseLeftButtonDownEvent),
                                          true);
                timeLineSlider.AddHandler(Slider.MouseLeftButtonUpEvent, new MouseButtonEventHandler(timeLineSlider_MouseLeftButtonUpEvent),
                                          true);
            }
        }
Esempio n. 2
0
        public ShellViewModel(MediaFileWatcher mediaFileWatcher, IRegionManager regionManager, IEventAggregator eventAggregator)
        {
            RegionManager   = regionManager;
            EventAggregator = eventAggregator;

            ImageViewModel = new ImagePanel.ImageViewModel(eventAggregator);
            ImageViewModel.SelectedScaleMode = UserControls.ImagePanel.ScaleMode.UNSCALED;

            imageMediaStackPanelViewModel = new MediaFileStackPanelViewModel(MediaFileWatcher.Instance.MediaFileState, EventAggregator);
            imageMediaStackPanelViewModel.MediaStateCollectionView.FilterModes.MoveCurrentTo(MediaFilterMode.Images);

            VideoViewModel = new VideoPanel.VideoViewModel(EventAggregator);

            videoMediaStackPanelViewModel = new MediaFileStackPanelViewModel(MediaFileWatcher.Instance.MediaFileState, EventAggregator);
            videoMediaStackPanelViewModel.MediaStateCollectionView.FilterModes.MoveCurrentTo(MediaFilterMode.Video);

            MediaFileBrowserViewModel = new MediaFileBrowserViewModel(mediaFileWatcher, regionManager, eventAggregator);

            VideoPlayerViewModel.setLibAVLogCallback(Logger.Log);
            VideoPlayerViewModel.enableLibAVLogging(LogMessageModel.LogLevel.INFO);

            createDatabase();

            VideoPlayer2.VideoPlayer2Test test = new VideoPlayer2.VideoPlayer2Test();
            //test.Test();

            //TestWindow window = new TestWindow();
            //window.Show();
        }
Esempio n. 3
0
        public ShellViewModel(MediaFileWatcher mediaFileWatcher, IRegionManager regionManager, IEventAggregator eventAggregator)
        {
                  
            RegionManager = regionManager;
            EventAggregator = eventAggregator;

            ImageViewModel = new ImagePanel.ImageViewModel(eventAggregator);
            ImageViewModel.SelectedScaleMode = UserControls.ImagePanel.ScaleMode.UNSCALED;
          
            imageMediaStackPanelViewModel = new MediaFileStackPanelViewModel(MediaFileWatcher.Instance.MediaFileState, EventAggregator);
            imageMediaStackPanelViewModel.MediaStateCollectionView.FilterModes.MoveCurrentTo(MediaFilterMode.Images);

            VideoViewModel = new VideoPanel.VideoViewModel(EventAggregator);

            videoMediaStackPanelViewModel = new MediaFileStackPanelViewModel(MediaFileWatcher.Instance.MediaFileState, EventAggregator);
            videoMediaStackPanelViewModel.MediaStateCollectionView.FilterModes.MoveCurrentTo(MediaFilterMode.Video);

            MediaFileBrowserViewModel = new MediaFileBrowserViewModel(mediaFileWatcher, regionManager, eventAggregator);

            VideoPlayerViewModel.setLibAVLogCallback(Logger.Log);
            VideoPlayerViewModel.enableLibAVLogging(LogMessageModel.LogLevel.INFO);

            createDatabase();

            VideoPlayer2.VideoPlayer2Test test = new VideoPlayer2.VideoPlayer2Test();
            //test.Test();

            //TestWindow window = new TestWindow();
            //window.Show();
        }