ns12345
ns12345

Reputation: 3105

passing param thru command parameter

how do i pass command param from MenuItem

<MenuItem CommandParameter="{Binding this, ElementName=Header}" />

OR how to pass a hardcoded string like

<MenuItem CommandParameter="something" />

I am using mvvm light, wpf

Upvotes: 1

Views: 1830

Answers (1)

Aaron McIver
Aaron McIver

Reputation: 24723

Try...

<MenuItem CommandParameter="{Binding RelativeSource={RelativeSource Self}, 
               Path=Header}"/>

Upvotes: 5

Related Questions