private void Accept_Click(object sender, RoutedEventArgs e) { if ((formatTextBox.Text != specItem.format) | (zonaTextBox.Text != specItem.zona) | (positionTextBox.Text != specItem.quantity) | (oboznachenieTextBox.Text != specItem.note) | (nameTextBox.Text != specItem.quantity) | (quantityTextBox.Text != specItem.quantity) | (noteTextBox.Text != specItem.quantity)) { specItem.format = formatTextBox.Text; specItem.zona = zonaTextBox.Text; specItem.position = positionTextBox.Text; specItem.oboznachenie = oboznachenieTextBox.Text; specItem.name = nameTextBox.Text; specItem.quantity = quantityTextBox.Text; specItem.note = noteTextBox.Text; project.AddSpecItem(specItem); this.DialogResult = true; } }