✅ Getting Access To Object For Return Value Avalonia
in my
I am trying to get access to that contact
so that it can pass that contact to where it needs to go. My problem right now is getting access to the desired contact of which button is clicked inside of the Expander so that it can be pushed back, and I am also stuck trying to figure out how to return that contact back to the
HomeScreenView.axaml file I have the code above. The ItemsControl is bound to a List<ContactModel> to which it iterates through and creates a DataTemplate for each contact that is stored in the database therefore inside of each DataTemplate is a contact. When the contact is expanded (see image) it comes with 2 buttons. One to edit the contact, and one to delete the contact. I am attempting to get access to the contact that the button click belongs to so that it can be returned. What I mean is that in my axaml file I am binding the CommandParameter of each button with {Binding} which is the contact's information that belongs to that button. In the HomeScreenViewModel.cs file I have I am trying to get access to that contact
{Binding} so that when the Edit button or the Delete button is clicked, it can send the correct contact and it's information back to the MainWindowViewModel for this functionso that it can pass that contact to where it needs to go. My problem right now is getting access to the desired contact of which button is clicked inside of the Expander so that it can be pushed back, and I am also stuck trying to figure out how to return that contact back to the
MainWindowViewModel correctly. Thanks