public void button_Click(object sender, RoutedEventArgs e) { Button Temp = sender as Button; string str = Temp.Name.ToString().Substring(6); if (str == "Home") { Home Window = new Home(); Window.Show(); this.Close(); } else if (str == "Menu") { Menu Window = new Menu(); Window.Show(); this.Close(); } else if (str == "Products") { Products Window = new Products(); Window.Show(); this.Close(); } else if (str == "Order") { Order Window = new Order(); Window.Show(); this.Close(); } }