Other examples are not working or are completly different from what I do.
So I have a button on my XAML page like this:
<Button Width="100"
Height="50"
Margin="0 0 10 0"
Command="{Binding MenuButtonViewModel.MenuButtonCommand, Source={StaticResource Locator}}"
CommandParameter="{Binding Parameter}"
IsEnabled="{Binding IsEnabled}">
And on my ViewModel this:
public RelayCommand MenuButtonCommand
{
get
{
return new RelayCommand(() =>
{
});
}
}
The question is how do I get the value of the commandparameter on my ViewModel?
public RelayCommand<String> MenuButtonCommand
{
get
{
return new RelayCommand((parameter) =>
{
Text = parameter;
});
}
}
This is not working, have no idea how to do this without having to use codebehind to pass the commandparameter value to the ViewModel.