I would like use a RadVirtualKeyboard to enter pin code in my application. And when I use it with DefaultKeyboardLayout.Numpad it work as expected - shows small pop-up windows with numpad keyboard. But when I try to load my custom layout it shows the same small window but width of keyboard's buttons is super wide.
I seems that loading custom layout reset width of UI element to full size keyboard and all my customs buttons are stretched.
Could you help me?
var kb = new RadVirtualKeyboard()
{
VirtualKeyboardTemplateSelector = (VirtualKeyboardTemplateSelector)(MyView.FindResource("KeyTemplateSelector")),
DefaultKeyboardLayout = DefaultKeyboardLayout.Numpad
};
keyboardWindow = new RadVirtualKeyboardWindow(kb)
{
Header = "Enter you number",
ResizeMode = ResizeMode.NoResize,
CanClose = false,
Width = 260
};
//load custom layout
byte[] byteArray = Encoding.UTF8.GetBytes(keyLayout);
Stream stream = new MemoryStream(byteArray);
kb.LoadLayout(stream);
keyboardWindow.Show();
Here is my layout:
<RadVirtualKeyboard xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<KeysLayout KeySpacing="0.1" Grid.Row="0" Grid.Column="0">
<Rows>
<Row>
<Keys>
<Key KeyType="Numpad" Width="1" Height="1" VirtualKey="103" />
<Key KeyType="Numpad" Width="1" Height="1" VirtualKey="104" />
<Key KeyType="Numpad" Width="1" Height="1" VirtualKey="105" />
<Key KeyType="Normal" Width="1" Height="1" VirtualKey="109" />
</Keys>
</Row>
<Row>
<Keys>
<Key KeyType="Numpad" Width="1" Height="1" VirtualKey="100" />
<Key KeyType="Numpad" Width="1" Height="1" VirtualKey="101" />
<Key KeyType="Numpad" Width="1" Height="1" VirtualKey="102" />
<Key KeyType="Normal" Width="1" Height="1" VirtualKey="107" />
</Keys>
</Row>
<Row>
<Keys>
<Key KeyType="Numpad" Width="1" Height="1" VirtualKey="97" />
<Key KeyType="Numpad" Width="1" Height="1" VirtualKey="98" />
<Key KeyType="Numpad" Width="1" Height="1" VirtualKey="99" />
<Key DisplayText="Enter" KeyType="Special" Width="1" Height="1" VirtualKey="13" />
</Keys>
</Row>
</Rows>
</KeysLayout>
</Grid>
</RadVirtualKeyboard>
And how it is showed