Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't see any real bad design here. </p> <p>You can build the UI for this as a list of product groups user has to pick from (ListBox bound to the ProductGroups collection), then you can have a user-control with a ListBox, property named CurrentGroupId and some control buttons (e.g. "OK"). Bind CurrentGroupId to the ProductGroups ListBox's selected value. When CurrentGroupId changes or Parameters collection changes, you should filter this inner ListBox items using LINQ or whatever - basically refill the ListBox with GroupParameter-s where CurrentGroupId matches selected ProductGroupId. ListBox items should be GroupParameter-s objects. </p> <p>Now (finally :) ) the answer to your question: you can data-template list's items to have a textbox, bound to the Value property like this (here 'local' is your namespace):</p> <pre><code>&lt;DataTemplate DataType={x:Type local:GroupParameter}&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;TextBox Text="{Binding Value, Mode=TwoWay}" /&gt; &lt;Button Content="OK" Click=INSERT_YOUR_OK_HANDLER_HERE /&gt; &lt;Button Content="Cancel" Click=INSERT_YOUR_CANCEL_HANDLER_HERE /&gt; &lt;/StackPanel&gt; &lt;/DataTemplate&gt; </code></pre> <p>If you need to give user an ability to add new parameters you can make some Add functionality which would add a new entry in the Parameters collection with currently selected group id. Then user can edit just added item in your user-control.</p> <p>Hope it helps, and if it's hard to understand what i've just said, i could write most of that in code, i guess. Don't hesitate to ask me to :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload