Nikhil
Nikhil

Reputation: 181

Config XML TO XAML

We have multiple configurations in our application and I'm trying to make a UI so the user has one stop shop to configure all the xml values. But instead of manually creating the UI screens, is there a way to generate the UI screens based of the xml key/value pairs? Just text boxes are fine.

Upvotes: 0

Views: 214

Answers (1)

Bitmask
Bitmask

Reputation: 958

Have you tried using ItemsControl:

<ItemsControl ItemsSource="{Binding}">
  <ItemsControl.ItemTemplate>
    <DataTemplate>
      <Textbox>..
    </DataTemplate>
  </ItemsControl.ItemTemplate>
</ItemsControl> 

(Have not tested the above code). You could read in the values from XML and bind to ItemsSource.

Upvotes: 1

Related Questions