【发布时间】:2015-03-02 16:26:53
【问题描述】:
非常简单的程序。也许太简单了? XMAL:
<RibbonComboBox x:Name="cbxRibbonCommsGroupBaud" LargeImageSource="Resource/Cheetah.png">
<RibbonGallery Name="RBaudGGallery" SelectionChanged="RBaudGGallery_OnSelectionChanged">
<RibbonGalleryCategory Name="RBaudGGalleryC" ItemsSource="{Binding}"></RibbonGalleryCategory>
</RibbonGallery>
</RibbonComboBox>
后面的代码:
private int[] baudRateList = { 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 };
cbxRibbonCommsGroupBaud.Items.Clear();
cbxRibbonCommsGroupBaud.ItemsSource = baudRateList;
当我运行程序时,这些项目位于组合框中的下拉列表中,但是当我选择该项目时,它不会保留,并且该框显示为空。此外,永远不会调用 RBaudGGallery_OnSelectionChanged。所以我遗漏了一些东西,但不知道是什么,因为其他组合框工作正常,不在功能区中。我正在使用 System.Windows.Controls.Ribbon 的参考。
【问题讨论】: