microsoft / xaml-standard

XAML Standard : a set of principles that drive XAML dialect alignment
Other
807 stars 54 forks source link

Proposal: Standardize Tag Property #221

Open francedot opened 6 years ago

francedot commented 6 years ago

Standardize a Tag Property as in UWP/WPF.

As of now, Xamarin.Forms View or Element base classes do not expose a Tag property. A Tag property could be useful for passing data from xaml to code behind when interacting with a control. There are other properties like ClassId and StyleId, which could be used for the same purpose of Tag but are not as semantically meaningful as Tag.

Tag Property

<Image x:Name="ExploreImage"
       Tag="Explore"
       Source="explore.png"
       WidthRequest="40"
       HeightRequest="40"/>