我尝试通过 RibbonComboBox 的代码修改所选项目:
<r:RibbonComboBox x:Name="RibbonComboxBoxEditEnemyProjectiles" Label="Projectile" SmallImageSource="img/history16.png">
<r:RibbonGallery SelectedItem="{Binding Path=iSpriteIdx}" >
<r:RibbonGalleryCategory ItemsSource="{Binding oProjectiles, Source={StaticResource GameInfos}}" />
</r:RibbonGallery>
</r:RibbonComboBox>
我尝试两种方法:
RibbonGalleryEditProjectileSprite.SelectedItem = GameData.oSprites[ idx ];
RibbonGalleryEditProjectileSprite.SelectedValue = GameData.oSprites[ idx ];
这种方法行不通。这样做的正确方法是什么?
谢谢