private void CheckIfAlternativeIsSelectedAndSetSelected(IUpgradeAlternative alternative,
                                                         AlternativeDataItem alternativeDataItem)
 {
     if (ConfigurationGroup.SelectedAlternative.Equals(alternative))
     {
         SelectedAlternativeItem = alternativeDataItem;
     }
 }
 private void GridViewItemWasSelected(DataCommon obj)
 {
     if (obj.GetType() == typeof (AlternativeDataItem))
     {
         var alternativeObject = (AlternativeDataItem)obj;
         if (SelectedAlternativeItem == null)
         {
             SelectedAlternativeItem = alternativeObject;
             return;
         }
         if (SelectedAlternativeItem.Equals(alternativeObject))
         {
             SelectedAlternativeItem = null;
             return;
         }
         SelectedAlternativeItem = alternativeObject;
     }
 }
 private void AddConfigurationAlternative()
 {
     var alternativeGroup = new ConfigurationGroup("possibleAlternatives", "alternatives", "\uE15E");
     if (ConfigurationGroup.Alternatives.Count < 1)
     {
         return;
     }
     foreach (var alternative in ConfigurationGroup.Alternatives)
     {
          var alternativeDataItem = new AlternativeDataItem(alternative, alternativeGroup);
          alternativeGroup.Items.Add(alternativeDataItem);
          if (ConfigurationGroup.SelectedAlternative != null)
          {
              CheckIfAlternativeIsSelectedAndSetSelected(alternative, alternativeDataItem);
          }
     }
     DataGroupElements.Add(alternativeGroup);
 }