开发者

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)]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜