0

View: <Button Command="{Binding GetChangeLogCommand}"

ViewModel: GetChangeLogCommand = new DelegateCommand(GetChangeLog);

Method:

public ICommand GetChangeLogCommand { get; set; } private async void GetChangeLog(bool isLatest) { // code goes here . . . } 

I'm going to useGetChangeLogCommand multiple time and pass boolean parameter is it possible with MVVM sorry I'm new with this.

4

1 Answer 1

0

If you are that particular to pass the button element to viewmodel You can use below code :

 CommandParameter="{Binding ElementName=YourButtonName}" 

You could even pass the entire window, user control, or a particular list or list item to the view model

 CommandParameter="{Binding ElementName=YourWindow}" CommandParameter="{Binding ElementName=Control}" 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.