我试图用一些数据绑定一个组合框.问题是我在组合框中有这样的数据:
<ComboBox>
<ComboBoxItem>Item 1</ComboBoxItem>
<ComboBoxItem>Item 2</ComboBoxItem>
<ComboBoxItem>Item 3</ComboBoxItem>
<ComboBoxItem>Item 4</ComboBoxItem>
<ComboBoxItem>Item 5</ComboBoxItem>
</ComboBox>
Run Code Online (Sandbox Code Playgroud)
当加载组合框的表单时,我有一个加载的资源,它有一个int,我想将它绑定到这个组合框.因此,如果该int为1,我希望组合框显示项目1等,当我更改组合框的项目时,我想相应地更新该int.
有没有办法将此资源绑定到组合框以实现?
先感谢您