I have the following haml:
<ItemsControl>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Content="{Binding Name}"></Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
In my code, I have an event that gives me access to a button. How can I take a button object and get the object to which the name is attached?
Here is the psudo code I would like to work:
public void MyEvent(Object obj)
{
Button myButton = (Button) obj;
MyBoundClass myObject = GetBoundClassFromProperty(myButton.Name);
}
source
share