private void bt_setting_Click(object sender, RoutedEventArgs e) { SettingWindow sw = new SettingWindow(); sw.PublicKey = this.publicKey; Nullable <bool> result = sw.ShowDialog(); if (result == true) { this.publicKey = sw.PublicKey; } }