private void DomainMapAdd_Click(object sender, RoutedEventArgs e) { Method11Grid.Items.Add(new DomainMapRow() { Source = _domainSourceValues, Target = _domainTargetValues }); Method11Grid.InvalidateArrange(); DomainMapRemove.IsEnabled = true; }
public void resetDomainValuesUI(List <ComboData> domainValues, string sourceTarget) { if (sourceTarget == _source) { _domainSourceValues = domainValues; } else if (sourceTarget == _target) { _domainTargetValues = domainValues; } if (_domainTargetValues != null && _domainTargetValues.Count > 0) { Method11Grid.Items.Clear(); for (int i = 0; i < _domainTargetValues.Count; i++) { ComboData domainValue = _domainTargetValues[i]; if (domainValue.Id != _noneField) // don't want to create a row for None by default { int selected = 0; // use the default None here... for (int s = 0; s < _domainSourceValues.Count; s++) { if (Equals(_domainSourceValues[s].Tooltip, domainValue.Tooltip)) // tooltip includes both coded value and description, only do initial match if identical values { selected = s; } } // used to always set source selected to 0 - None Method11Grid.Items.Add(new DomainMapRow() { Source = _domainSourceValues, SourceSelectedItem = selected, SourceTooltip = "None", Target = _domainTargetValues, TargetSelectedItem = i, TargetTooltip = getDomainTooltip(domainValue.Id, domainValue.Value) }); } } } if (Method11Grid.Items.Count > 0) { DomainMapRemove.IsEnabled = true; } else { DomainMapRemove.IsEnabled = false; } Method11Grid.InvalidateArrange(); }