tags:

views:

28

answers:

0

Here is, roughly, what I'm trying to achieve:

illustration

The green part is fixed.
Cells in the orange (or pink?) part are editable.
Cells in the blue part are also editable.
The [add fridge] button adds another column.

Now the tricky part:
The blue+green parts should, together, be scrollable vertically.
The blue+orange parts should, together, be scrollable horizontally.
(the dark red thingies represent scrollbars)

One can see the logic behind this: I must be able to edit product quantities for any (reasonable) number of fridges and products, even if they don't all fit on the screen. But I must never scroll either fridge names or product names out of sight.

I would like to accomplish this layout solely in XAML, with bindings (an ObservableCollection<Fridge> immediately jumps to mind). Writing custom converters also would be acceptable. The main point is to avoid creating/managing UI elements programmatically.

A few considerations from my previous thoughts and experiments:

  1. Can't use Grid, since it can't autogenerate columns from sequence

  2. A series of nested ItemsControls could work, but then I run into the problem of aligning items from different sequences (i.e. blue cells with either orange or green ones - depending on the direction of nesting) - see my other question.

  3. Bonus points for resizing the fridge columns. So far I've only managed to find GridSplitter, but it only works with grid.