private void SetupNamesEditor(NamesEditor namesEditor, string buttonCaption, RoutedEventHandler routedEventHandler, string toolTip) { namesEditor.AddButtonCaption.Text = buttonCaption; namesEditor.AddButton.ToolTip = toolTip; // Remove existing handler if present (NB: -= should never crash) namesEditor.AddButton.Click -= routedEventHandler; namesEditor.AddButton.Click += routedEventHandler; namesEditor.AddButton.IsEnabled = false; }
private void LoadNamesEditor(NamesEditor namesEditor, ObservableCollection <TextualProperty> data) { namesEditor.AddButton.IsEnabled = data != null; namesEditor.NamesModel.ListOfNames = data; }