private void FileMenuNewClient_Click(object sender, RoutedEventArgs e) { CreateEditClientWindow createEditClientWindow = new CreateEditClientWindow(); if (createEditClientWindow.ShowDialog().GetValueOrDefault()) { Clients.Add(createEditClientWindow.Client); UpdateGUI(); } }
private void ClientMenuItem_Click(object sender, RoutedEventArgs e) { if (sender is MenuItem menuItem) { foreach (var Client in Clients) { if (menuItem.Header.ToString() == Client.ToString()) { var createEditClientWindow = new CreateEditClientWindow(Client); if (createEditClientWindow.ShowDialog().GetValueOrDefault()) { UpdateGUI(); } return; } } } }