private void HousesLbl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var hw = new HousesWindow(); //this will open your child window hw.Show(); //this will close parent window. windowOne in this case Close(); }
private void SaveBtn_Click(object sender, RoutedEventArgs e) { if (nameTb.Text != "" && adressTb.Text != "" && stateTb.Text != "") { hs.CreateHouse(nameTb.Text, adressTb.Text, photo, decimal.Parse(stateTb.Text), commentsTb.Text); MessageBox.Show("Added successfully !"); var hw = new HousesWindow(); hw.Show(); Close(); } }