views:

19

answers:

0

I have a number of items which I wish to be contained in either a ListBox or an ItemsControl. The size of the control is fixed, but the size of its contents are not. It is possible for this control to have 13 items inside, but if the user wishes, only one is displayed at a time, and takes up the entirety of the available space. Two items visible roughly splits the available space in two and so-on.

I don't "require" selection, but I do require a context menu.

If I use a ListBox, I get almost everything I want EXCEPT that if I select an item on the far right, it will be centered and the view "jumps". I don't want this. However, if I use an itemscontrol, when the size of the items contained changes ItemsControl just draws completely wrong proportions (sets width to aprox 120% of what it should be if just one item were displayed).

Which control should I use? And I do I 'fix' it to do what I want?