private void OnAddCondition(object item) { ExpressionPanel panel = GetNewExpressionPanel(null); panel.Arg1TextBox.IsEnabled = false; panel.Arg1TextBox.Text = "Result"; this.ConditionPanel.Children.Add(panel); if (this.ConditionPanel.Children.Count == 1) { panel.OperatorComboBox.IsEnabled = false; panel.OperatorComboBox.SelectedItem = ""; } if (this.IsReadOnly) { panel.SetReadOnly(this.IsReadOnly); } }