You might need to rethink this whole situation. A HashSet
is a 'set' of unique items, not a collection. A set is simply meant to maintain a group of members and to enable you to check whether a particular item is a member or not... there's no indexing because there is no order amongst the set items.
Although you can call the Enumerable.ElementAt<TSource>
method on a HashSet
, you cannot guarantee that it will return the same element when providing the same input value to the method. Most importantly, if the order of items in the HashSet
is important to you, then you should be using a collection instead.
However, if you choose to ignore this advise, this is how you could achieve your requirement... just define a wrapper property for your single HashSet
value... you could try something like this:
public YourHashSetDataType Hash
{
get { return LeadSteps.ElementAt(0).NewZoneID; }
set { LeadSteps.ElementAt(0).NewZoneID = value; NotifyPropertyChanged("Hash"); }
}