Пример #1
0
        private static unsafe void Main()
        {
            MainWindow mainWindow = new MainWindow();

            MSG message = new MSG();
            while (message.message != NativeConstants.WM_QUIT)
            {
                if (NativeMethods.PeekMessage(&message, IntPtr.Zero, 0, 0, NativeConstants.PM_REMOVE))
                {
                    NativeMethods.TranslateMessage(&message);
                    NativeMethods.DispatchMessage(&message);
                }
            }
        }
Пример #2
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            try
            {
                var myWindow = new MainWindow { ViewModel = new ViewModels.MainWindowViewModel() };

                myWindow.Show();
            }
            catch (Exception ex)
            {
                string message = string.Format("Exception: {0} \n\nStack: {1}", ex.Message, ex.StackTrace);
            }
        }
Пример #3
0
 public StartStopCommandImpl(MainWindow mainWindow)
 {
     this.mainWindow = mainWindow;
     mainWindow.PropertyChanged += (object o, PropertyChangedEventArgs e) => {
         if (e.PropertyName == "VideoPreview")
         {
             if (CanExecuteChanged != null) { CanExecuteChanged(this, new EventArgs()); }
         }
     };
 }