private void AddToCollection (XamlObjectElement obj, object value) { IList list = prop.GetValue (target, null) as IList; if (list == null) { throw Parser.ParseException ("Collection property in non collection type."); } list.Add (value); }