【发布时间】:2016-05-22 08:37:57
【问题描述】:
A 有一个 Button 和一个 Command。对于每个包含命令的按钮,我想将 InputGestureText 显示为 ToolTip。
这是我尝试过的:
<n:ImageButton x:Name="NewRecordingButton" Text="Recording"
Command="util:Commands.NewRecording"
ToolTip="{Binding Source=util:Commands.NewRecording, Path=InputGestureText}"
ToolTipService.Placement="Top" ToolTipService.HorizontalOffset="-5"/>
为简洁起见,我删除了一些元素。
我正在尝试实现与MenuItem 类似的结果。如果用户将鼠标悬停在按钮上,我想显示快捷方式。
【问题讨论】:
-
代替 Source ,你使用了 path 属性吗?
标签: c# wpf xaml tooltip routed-commands