public MainWindow() { //主线程操作UI的线程队列 Application.Current.Properties["UIDispatcher"] = this.Dispatcher; //用户登录 AccountWindow win = new AccountWindow(); if (win.ShowDialog() != true) { this.Close(); return; } InitializeComponent(); this.ViewModel = new MainViewModel(this.pane, this.stusBar, this.pgr); this.DataContext = this.ViewModel; }
private void startButton_Clicked(object sender, RoutedEventArgs e) { AccountWindow acw = new AccountWindow(); acw.ShowDialog(); }