To start, understand that I'm dealing with a dynamic interface that is generated at run-time from XML. I have written XAML that switches on various elements and attributes to create the appropriate controls and labels, in order to display the data contained in the augmented XML file.
Sample XML fragment:
<floop Format="combo" Choices="apple;banana;cherry" Value="cherry"/>
Format and value works already. I'm looking for a way to make Choices work. (Yes this is unconventional for XML, but it serves the purpose for now.)
Here's a proposed XAML fragment:
<ComboBox Style="{StaticResource ComboButtonStyle}"
Width="200"
ItemsSource="{Binding XPath=@Choices}" IsEditable="True"
/>
The thing is, @Choices is a single string, so I'm proposing to parse the string to produce the type of data ItemsSource wants.
How do I get there from here?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…