private void Search_BT_Click(object sender, RoutedEventArgs e) { SearchWindow search_obj = new SearchWindow(); search_obj.Show(); var mainwin = Application.Current.MainWindow; mainwin.Hide(); search_obj.GetSearchInfo(Search_box.Text); Search_box.Text = searchboxtxt; }