I am trying to build a GUI using WPF, in which I can draw some basic shapes and store them into a xml file. Shapes are designed in a xaml file, and I added tags for each of them
Here is a example: assuming you have UI element is XAML (Button
named _btn
) with Tag
property set to some value, then in any event handle (e.g. Click) associated with that element in code behind you can get the Tag value as follows:
_btn.Click+=(s,e,)=>{ string _tag = (s as Button).Tag.ToString(); };
You can apply the same logic to you case. Rgds,