RibbonComboBox没有selectionChanged事件 [英] RibbonComboBox has no selectionChanged event

查看:54
本文介绍了RibbonComboBox没有selectionChanged事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序中有一个组合框,它可以正常工作

I have a combo box in my program and it works as it should

但是我希望它成为WPF应用程序中功能区的一部分

However I want this to be a part of my ribbon in my WPF application

我已经创建了一个功能区组合框",但是这似乎没有选择更改事件,就像普通的组合框一样

I have created a 'ribbon combo box', however this does not seem to have a selection changed event, like the normal combo box does

这是为什么?

如果我将标准组合框中的代码剪切并粘贴到功能区组中,则会创建该框,但是在运行程序时该框为空

If I cut and paste the code from my standard combo box into a ribbon group, the box is created however it is empty when I run the program

我运行程序的唯一方法是注释掉if语句中的代码(基于组合框的选择,我想发生的事情)

Also the only way I can run the program is by commenting out the code within my if statement (for what I want to happen based on the combo box selection)

推荐答案

如果您使用的是

If you are using the Microsoft Ribbon for WPF, the SelectionChanged event can be found in the RibbonGallery

<ribbon:RibbonComboBox Style="{StaticResource SubPosition}" SelectionBoxWidth="20" IsEditable="True">
    <ribbon:RibbonGallery Name="rbngFontSizes" SelectedValue="11" SelectedValuePath="Content" SelectionChanged="rbngFontSizes_SelectionChanged">
        <ribbon:RibbonGalleryCategory ItemsSource="{Binding}" />
    </ribbon:RibbonGallery>
</ribbon:RibbonComboBox>

这篇关于RibbonComboBox没有selectionChanged事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆