当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - How to click RibbonMenuButton .Net

问题描述:

how can I click RibbomMenuItem? I have xaml code

<Custom:RibbonMenuButton Name="bt1" Label="Stop"/>

but I can't use Click property to run background function write in .cs file. How can I handle Click event for this?

网友答案:

RibbonMenuButton dont have Click event.
Use MouseLeftButtonDown of PreviewMouseLeftButtonDown instead.

<Custom:RibbonMenuButton MouseLeftButtonDown="b_MouseLeftButtonDown" Name="bt1" Label="Stop"/>

In the code:

void b_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
}
分享给朋友:
您可能感兴趣的文章:
随机阅读: