/// <summary> /// 配置数据源 /// </summary> private void DataSourceConfig_Executed(object sender, ExecutedRoutedEventArgs e) { var datasource = new DataSourceView(); MainView mainWindow = FindName("mainWindow") as MainView; datasource.WindowStartupLocation = WindowStartupLocation.CenterOwner; datasource.Owner = mainWindow; datasource.ShowDialog(); //datasource.Owner = window; }