private void BtnChangeClick(object sender, RoutedEventArgs e) { var existingClient = (IClient)listBoxClient.SelectedItem; var windowChange = new ClientBox(existingClient) { Title = GetType().Name }; var clientWasChanged = windowChange.ShowDialog(); if (clientWasChanged == true) { clients.Remove(existingClient); var updatedClient = PluginContext.Operations.GetClientById(existingClient.Id); clients.Add(updatedClient); } }
private void BtnAddClick(object sender, RoutedEventArgs e) { var windowAdd = new ClientBox(null) { Title = GetType().Name }; windowAdd.ShowDialog(); var createdClient = windowAdd.CreatedClient; if (createdClient == null) { return; } clients.Add(createdClient); }