public Test() { _viewModel = new MainWindowViewModel(DialogCoordinator.Instance); DataContext = _viewModel; InitializeComponent(); var accent = ThemeManager.Accents.First(x => x.Name == "Purple"); var theme = ThemeManager.GetAppTheme("BaseLight"); ThemeManager.ChangeAppStyle(Application.Current, accent, theme); TaskEx.Delay(2000); homepage.IsEnabled = false; MediaTimeline timeline = new MediaTimeline(new Uri("Wildlife.wmv", UriKind.RelativeOrAbsolute)); clock = timeline.CreateClock();//创建控制时钟 MediaElement mediaElement = Resources["video"] as MediaElement;//得到资源 orgin.Child = mediaElement; mediaElement.Clock = clock; clock.Controller.Seek(new TimeSpan(0, 0, 0, 2), TimeSeekOrigin.BeginTime);//跳过固定的时间线 clock.Controller.Stop(); clock.Controller.Begin(); MainTabControl.SelectionChanged += MainTabControl_SelectionChanged; clock.Completed += Clock_Completed; }
public MainWindow() { DataContext = new MainWindowViewModel(); InitializeComponent(); var t = new DispatcherTimer(TimeSpan.FromSeconds(2), DispatcherPriority.Normal, Tick, this.Dispatcher); CollectionViewSource.GetDefaultView(groupingComboBox.ItemsSource).GroupDescriptions.Add(new PropertyGroupDescription("Artist")); }
public MainWindow() { DataContext = new MainWindowViewModel(Dispatcher); InitializeComponent(); var t = new DispatcherTimer(); t.Tick += Tick; t.Interval = new TimeSpan(0, 0, 0, 1); t.Start(); }
public MainWindow() { _viewModel = new MainWindowViewModel(); DataContext = _viewModel; InitializeComponent(); flyoutDemo = new FlyoutDemo(); flyoutDemo.Closed += (o, args) => flyoutDemo = null; Closing += (s, e) => { if (!e.Cancel && flyoutDemo != null) { flyoutDemo.Dispose(); } }; }
public MainWindow() { _viewModel = new MainWindowViewModel(DialogCoordinator.Instance); DataContext = _viewModel; InitializeComponent(); flyoutDemo = new FlyoutDemo(); flyoutDemo.ApplyTemplate(); flyoutDemo.Closed += (o, e) => flyoutDemo = null; Closing += (s, e) => { if (!e.Cancel && flyoutDemo != null) { flyoutDemo.Dispose(); } }; }
void MainWindowLoaded(object sender, RoutedEventArgs e) { DataContext = new MainWindowViewModel(); }
public MainWindow() { DataContext = new MainWindowViewModel(); InitializeComponent(); var t = new DispatcherTimer(TimeSpan.FromSeconds(2), DispatcherPriority.Normal, Tick, this.Dispatcher); }
public MainWindow() { DataContext = new MainWindowViewModel(); InitializeComponent(); }
public MainWindow() { _viewModel = new MainWindowViewModel(); DataContext = _viewModel; InitializeComponent(); }
public FlyoutDemo() { DataContext = new MainWindowViewModel(); this.InitializeComponent(); }