I have a method in my MouthDiseaseViewModel
public void Insert(MouthDisease entity, DetailsUserControl userCon)
{
//some code for saving to the db
}
How can I pass these two parameters (1 MouthDisease object and a UserControl) to the command button parameter?
<Button Content="Update" Command="{Binding MouthInsertCommand}" >
<Button.CommandParameter>
<Binding></Binding><!--stuck here-->
</Button.CommandParameter>
</Button>
EDIT
This is not a duplicate! I saw the link that Peter put and it has two parameters with the same type and the same element. I was pointing that my parameters are an object from the ViewModel and the current UserControl from the view. All of the samples i've seen were about width and height or tag and name that has the same data types.
anyway, as Tseng pointed out, I violated the pattern. I thought View and Model are the only classes that should not reference with each other.
so as I edit this, what if my ViewModel.Insert's signature is like this:
public void Insert(MouthDisease entity, User currentUser)
{
//some code for saving to the db
}
How do I write this method with two different data types in markup?