// Constructs the Legendary object. public void SerializeTraits() { if (Traits.Items.Count == 0 || String.IsNullOrEmpty(LegendaryAbilityName.Text)) { return; } LegendaryAbility = new Legendary(); LegendaryAbility.Title = LegendaryAbilityName.Text; foreach (string item in Traits.Items) { LegendaryAbility.AddTrait(item.Split('|')[0].Trim(), item.Split('|')[1].Trim()); } }