Я хотел бы, чтобы вы спросили, возможно ли как-то указать в ListBoxItem
строку, которая появится, и значение, которое будет храниться в БД. Это действительно возможно:
ItemSource={Binding MyEnumColleciton}
or
ItemSource={DynamicResource MyCollection}
и т.д..
но если вы представляете, что у меня около 100 ListBox. Я не хочу иметь так много разных перечислений и других коллекций ItemSource, я хочу записать их непосредственно в ListBoxItem.
Вот о чем я говорю:
<ListBox SelectedItem="{Binding Path=MyPath1}" Style="{StaticResource RadioButtonList}">
<ListBoxItem Content="Text1" />
<ListBoxItem Content="Text2" />
</ListBox>
<ListBox SelectedItem="{Binding Path=MyPath2}" Style="{StaticResource RadioButtonList}">
<ListBoxItem Content="Text3" />
<ListBoxItem Content="Text4" />
</ListBox>
<ListBox SelectedItem="{Binding Path=MyPath3}" Style="{StaticResource RadioButtonList}">
<ListBoxItem Content="Text5" />
<ListBoxItem Content="Text6" />
</ListBox>
... 100x