This is for a UWP application for raspberry pi (c#). I have a button as a public member of a class written by me. Since this is a member of class. Whenever an object of this class is created, it needs to have a Click event. I need to have the click event inside the MainPage.xaml.cs file in order for it to have access to other functions, instead of the actual class.
I am able to use the following code:
ExecutionSequence newSeq = new ExecutionSequence();
newSeq.SelectionButton.Click += SelectionButton_Click;
private void SelectionButton_Click(object sender, RoutedEventArgs e)
{
Button tempbutton = sender as Button;
}
The above code gives full access of the properties of the Button.
However, I am looking for help in the above scenario to access the actual object of class to which this button belongs to as the event requires to access other members of class.
Please note that I considered making the click event as another member of the class itself. But it makes things complex in my case.