tags:

views:

19

answers:

1

I'm having some trouble coming up with a xaml page that would bind to a keyboard layout displayed on a page. Originally I have an ObservableCollection of rows that contain a KeyboardKey datatypes that specify the width of a button. The collection is bound to a listbox in the xaml. The problem I'm having is that on some keyboards the the height of a key spans two rows, which the xaml listbox does not support. I would like to avoid hard coding a bunch of keys in the xaml. Any thoughts on how to approach this?

A: 

You can create you own layout buy inheriting one of container controls and overriding ArrangeOverride method.

You can find the example here: http://www.wpftutorial.net/CustomLayoutPanel.html

When I was creating the virtual keyboard, I declined automatic layout and put the buttons manually in designer. I think in some cultures it is better to put key rows with horizontal shift and in others it is better to to place buttons under each other. So I have a flexible layout and can quickly edit it in designer.

Andrey Gordeyev