Esempio n. 1
0
        public PlayListManagerWindow()
        {
            DataContext = VM;

            InitializeComponent();

            Context.MediaPlayerCommands = _mediaPlayerCommands = new MediaPlayerCommands(this, enableKeyboardShortcuts: false);
        }
Esempio n. 2
0
        public MainWindow(string [] commandLine)
        {
            _commandLine = commandLine;
            Log.d("MediaPlayer.MkZ - MainWindow - c-tor");

            InitializeComponent();

            this.DataContext = Context;

            Context.PlayerVM            = _player.DataContext as VideoPlayerControlVM;
            Context.MediaPlayerCommands = _mediaPlayerCommands = new MediaPlayerCommands(this, enableKeyboardShortcuts: true);

            _cmbFilesList.Items.Clear();
            _cmbFilesList.ItemsSource = null;

            _controlsHideAndShow = new FadeAnimationHelper(this, 2, _imagesNavigation, _cursorArrow);

            _clock.Zoomable.EnableZoom(_scrollMain);
            _reiKiProgress.Zoomable.EnableZoom(_scrollMain);

            _zoomImage = new ScrollDragZoom(_imageBackground, _scrollMain);
            _zoomImage.FitWindow(0);

            Context.AppConfig.Settings.PropertyChanged          += Config_PropertyChanged;
            Context.AppConfig.MediaDatabaseInfo.PropertyChanged += MediaDatabaseInfo_PropertyChanged;

            _hideHeaderAnimationHelper = new GridLengthAnimationHelper(this, rowHeader);

            SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;

            Context.AppConfig.Load();

            //add or select file if exists
            ProcessCommandLine();

            MediaDB.OnPlayListSelectionChangedAction = (playList) =>
            {
                SetPlayList(playList);
            };

            _player.OnFullScreenButtonClick = (vm) => FullScreenToggle();
            _player.OnFileDropAction        = (fileNames) =>
            {
                AddNewMediaFiles(fileNames, PlayerVM.Volume > 0 ? PlayerVM.Volume : 0.3);
            };

            PlayerVM.MediaEndedAction  = (vm) => OnMediaEnded(vm);
            PlayerVM.MediaFailedAction = (vm, ex) => OnMediaFailed(vm, ex);

            Context.AppConfig.Settings.MainWindowState.RestoreTo(this);
            this.WindowState = WindowState.Normal; //always normal - to position on correct screen for maximize
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _playerState.RestoreStateTo(_vm);

            //here is - close full screen window
            _player.OnFullScreenButtonClick = (vm) =>
            {
                _playerState.CopyFrom(vm.GetPlayerState());
                vm.Stop();
                this.Close();
            };

            _mediaPlayerCommands = new MediaPlayerCommands(this);
        }
Esempio n. 4
0
 private void Window_Closed(object sender, EventArgs e)
 {
     _mediaPlayerCommands.Dispose();
     _mediaPlayerCommands = null;
 }