public void ShowDialog() { _dialog.Title = Title; ComponentUtils.InsertIconToPanel(_dialog.InfoPanel, AppResources.GetInfoIcon, "Для большей информации об атрибуте, наведите на название этого атрибута"); _entityList = new GenericEntityListControl <T>(ListTitle, _columnMatcher, DisplayUpdate); _dialog.ListPanel.Children.Add(_entityList.GetUiElement()); foreach (var p in _propertyRows) { _dialog.PropertiesPanel.Children.Add(p); } ComponentUtils.InsertIconToButton(_dialog.AddButton, AppResources.GetAddItemIcon, OpenAddNewItemWindowButtonTitle); _dialog.AddButton.Click += (sender, args) => DisplayNew(); _addButton.Click += (sender, args) => { if (!AddItemFunction.Invoke()) { return; } _entityList.SetSource(UpdateCollectionFunction.Invoke()); DisplayNew(); }; _updateButton.Click += (sender, args) => { var selected = _entityList.Selected; if (!UpdateItemFunction.Invoke(selected)) { return; } var updatedList = UpdateCollectionFunction.Invoke().ToList(); _entityList.SetSource(updatedList); _entityList.Selected = updatedList.First(t => t.Id == selected.Id); }; _removeButton.Click += (sender, args) => { if (!RemoveItemFunction.Invoke(_entityList.Selected)) { return; } _entityList.SetSource(UpdateCollectionFunction.Invoke()); DisplayNew(); }; _entityList.SetSource(UpdateCollectionFunction.Invoke()); _dialog.ShowDialog(); }