public StringOperationPrototype(StringOperation prototypeOperation, Window contextWindow) { prototype = prototypeOperation; AddContext = contextWindow as MainWindow; CreateNewOperation = new DelegateCommand(temp => { StringOperation tempOperation = prototype.Clone(); AddContext.operationsList.Add(tempOperation); try { tempOperation.OpenDialog(); } catch { //do nothing } } , null); }
private void DeleteButton_Click(object sender, RoutedEventArgs e) { StringOperation local = ((sender as System.Windows.Controls.Button).Tag as StringOperation); operationsList.Remove(local); }