Send menu item name as parameter to view-model method [WPF, Caliburn.Micro]
Hi I bind event PreviewMouseLeftButtonDown on view-model method, I would like send as parameter menu item name.
in view I have this:
<MenuItem Name="Online"
Header="Online"
Micro:Message.Attach="
[PreviewMouseLeftButtonDown]=[Action ChangeStatus(Name)]">
开发者_开发百科
So in thi case I would like send Name =>("Online") as string to method:
view-model:
public void ChangeStatus(string status)
{
MessageBox.Show(status);
}
Any advance?
similar problem as in this message, you have to write
[PreviewMouseLeftButtonDown]=[Action ChangeStatus(Online.Name)]
精彩评论