c# get amount of elements in enum code example Example: c# get amount of elements in enum int count = Enum.GetValues( typeof( ContentAlignment ) ).Length;