Set Selected Item of WPF Combobox to User Setting
问题 I have a combo box with an item source set as a collection of 'Category'. The SelectedValuePath is the CategoryID property. I have a user setting 'DefaultCategory' that is an integer of which should set the CategoryID. I want the combo box to have a selection of the DefaultCategory user setting. xmlns:my="clr-namespace:MyApp" <ComboBox x:Name="cmbCategory" DisplayMemberPath="Category" SelectedValuePath="CategoryID" SelectedValue="{Binding Source={x:Static my:MySettings.Default}, Path