private void Button_Click(object sender, RoutedEventArgs e) { if (sender is Button) { Button button = sender as Button; if (button == AddCarButton) { WindowProvider.AdminOpenEditEntityPage("EditCar"); } else if (button == AddProductButton) { WindowProvider.AdminOpenEditEntityPage("AddProduct"); } else if (button == manufacturerButton) { WindowProvider.AdminOpenEditEntityPage("EditManufacturer"); } } }