RibbonSplitButton点击事件
绅士,
我正在将一个集合绑定到 RibbonSplitButton (基本上,显示 3 个值:红色、绿色、蓝色) 除了我必须弄清楚选择了哪种颜色(项目)的问题之外,一切正常:
这是我的代码:
<r:RibbonSplitButton Name="TagEm"
LargeImageSource="Images\pencil_32.png"
Label="Tag"
ItemsSource="{Binding Path=TagCollection}"
Click="TagEm_Click">
<r:RibbonSplitButton.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Descr}" />
</DataTemplate>
</r:RibbonSplitButton.ItemTemplate>
</r:RibbonSplitButton>
代码后面:
private void TagEm_Click(object sender, RoutedEventArgs e)
{
}
类似(Tag)TagEm.Items.CurrentItem
;
有人可以给我提示吗?
非常感谢!
N。
Gentelman,
I'm binding a collection to RibbonSplitButton (basically, showing 3 values: red, green, blue) Everything works fine except of the problem I have to figure out which color (item) has been chosen:
Here's my code:
<r:RibbonSplitButton Name="TagEm"
LargeImageSource="Images\pencil_32.png"
Label="Tag"
ItemsSource="{Binding Path=TagCollection}"
Click="TagEm_Click">
<r:RibbonSplitButton.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Descr}" />
</DataTemplate>
</r:RibbonSplitButton.ItemTemplate>
</r:RibbonSplitButton>
Code behind:
private void TagEm_Click(object sender, RoutedEventArgs e)
{
}
Something like (Tag)TagEm.Items.CurrentItem
;
Could someone give me a hint, please?
Many thanks in advance!
N.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要使用 RibbonSplitButton Click 事件。请改用 TextBox MouseLeftButtonUp 事件。
XAML:
事件处理程序:
Do not use the RibbonSplitButton Click event. Instead use the TextBox MouseLeftButtonUp event.
XAML:
Event Handler: