I am currently working on a c# project where I need to add to bits of information to the tag property. I was hoping to create it via a class in the same sort of way as the List list array.
There are two strings that I need to add to the tag property, so can this be done.
Yes it can:
checkBox.Tag = new Tuple<string, string>("", "");You can get the type out thus:
var stringPair = (Tuple<string, string>)checkBox.Tag;As for what string you want, it depends on how you’ve put them in there. This is where your own logic would decide. Tuples expose the entries as properties of the relevant type, in this case you’ll have two string properties.
Tag is an object, object’s can contain whatever you like. You just need to cast out. Binding to this, on the other hand, might be a little difficult.