WPF MainWindowの取得 一番上位の親であるメインウインドウを取得する MainWindow mainWindow = (MainWindow)Application.Current.MainWindow; ;