상속: INotifyPropertyChanged
예제 #1
0
        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;
           


        }
예제 #2
0
        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"));
        }
예제 #3
0
 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();
                    }
                };
        }
예제 #6
0
 void MainWindowLoaded(object sender, RoutedEventArgs e)
 {
     DataContext = new MainWindowViewModel();
 }
예제 #7
0
 public MainWindow()
 {
     DataContext = new MainWindowViewModel();
     InitializeComponent();
     var t = new DispatcherTimer(TimeSpan.FromSeconds(2), DispatcherPriority.Normal, Tick, this.Dispatcher);
 }
예제 #8
0
 public MainWindow()
 {
     DataContext = new MainWindowViewModel();
     InitializeComponent();
 }
예제 #9
0
 public MainWindow()
 {
     _viewModel = new MainWindowViewModel();
     DataContext = _viewModel;
     InitializeComponent();
 }
예제 #10
0
 public FlyoutDemo()
 {
     DataContext = new MainWindowViewModel();
     this.InitializeComponent();
 }