/// <summary> /// Removes top x subcategories, where x is defined by input parameter. /// </summary> /// <param name="howMany">Indicates how many subcategories you want to remove.</param> public void RemoveLastSubcategories(int howMany) { int count = SubCategories.Count; for (int i = count - 1; i > count - howMany - 1; --i) { SubCategories.RemoveAt(i); } Parent.IsResultChanged = true; }