private void lbl_progress_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { _progress_state = _progress_state == DURATION_LABEL.ELAPSED ? DURATION_LABEL.REMAINING : DURATION_LABEL.ELAPSED; _lbl_progress_update(); }
private void _init_rest() { lbl_title.Content = lbl_title.Content as string + " v" + GetRunningVersion(); _is_expanded = main_context_view_expanded.IsChecked; _is_fullscreen = false; _player_state = PLAYER_STATE.NOT_LOADED; _progress_state = DURATION_LABEL.ELAPSED; _current_media_type = MEDIA_TYPE.VIDEO; _ml_main_background = border_media_element.Background; _resize_mode_default = this.ResizeMode; _temp_position = TimeSpan.MinValue; _playlist_history = new Stack<MyMediaFile>(100); _timer = new DispatcherTimer(); _timer.Interval = new TimeSpan(0, 0, 1); _timer.Tick += new EventHandler((sender, e) => { if (!_is_slider_dragging && _player_state == PLAYER_STATE.PLAYING) { sl_progress.Value = ml_main.Position.TotalSeconds; this.TaskbarItemInfo.ProgressValue = ml_main.NaturalDuration.HasTimeSpan ? sl_progress.Value / ml_main.NaturalDuration.TimeSpan.TotalSeconds : 0; } }); _timer.Start(); _components_visible_timer = new DispatcherTimer(); _components_visible_timer.Interval = new TimeSpan(0, 0, CONSTANT_HIDE_COMPONENTS_DELAY); _components_visible_timer.Tick += new EventHandler((sender, e) => { if (_is_expanded || _is_fullscreen && _player_state == PLAYER_STATE.PLAYING && !main_context.IsOpen) { _components_state(Visibility.Hidden); } }); _components_visible_timer.Start(); _timer_dragmove = new DispatcherTimer(); _timer_dragmove.Interval = new TimeSpan(0, 0, 0, 0, DRAGMOVE_TIME_MS); _timer_dragmove.Tick += new EventHandler((t_sender, t_e) => { if (Mouse.LeftButton == MouseButtonState.Pressed) { DragMove(); } _timer_dragmove.Stop(); }); /* Subscribe to custome eventhandler for external application launch */ App.ExternelApplicationLauncy += mainwindow_root_loaded; }