E.g. you have a method like this:
private async void EditComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
You can detect which object (ComboBox in this example) triggered it with this:
var PageObject = sender as ComboBox;
if (PageObject.Name == "MyObjectName")
{
}
If you use names that include an ID value, say:
var PageObject = sender as ComboBox;
if (PageObject.Name.Contains("MyObjectName"))
{
string sThisObjectId = PageObject.Name.Substring(12); //Convert "MyObjectName14" to "14"
}
Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.