We have released version 5.1 of WPF Virtual Keyboard control. It contains the following new features and improvements:
Layout ringYou can define a sequence of keyboard layouts that can be cycled through by setting the LayoutRing property. Add LayoutRingKey to your layouts to let users cycle through the list. Layouts from this list are automatically assigned to TemplateLayout when user presses the LayoutRingKey, or if you call the SelectLayout method from code.
The KeyboardLayout class includes two new properties to control the appearance of the LayoutRingKey: Image and Label. One of these is displayed by the key to indicate the next layout in the cycle, following this priority:
1. If the next layout has a non-null / empty Image property, that image is displayed.
2. If there is no Image assigned to the layout, but the Label property is set, that text is displayed as key's Content.
3. If neither Image nor Label is set, the key will display the Unicode keyboard symbol (U+2328) as a fallback.
This code from the LayoutRing sample project demonstrates how to load layouts and populate the LayoutRing:
var lettersLayout = KeyboardLayout.Create("letters.xml");
var numbersLayout = KeyboardLayout.Create("numbers.xml");
var symbolsLayout = KeyboardLayout.Create("symbols.xml");
virtualKeyboard.LayoutRing.Add(lettersLayout);
virtualKeyboard.LayoutRing.Add(numbersLayout);
virtualKeyboard.LayoutRing.Add(symbolsLayout);
virtualKeyboard.SelectLayout(0);
SVG imagesThe library now includes an SVG renderer, letting you load key icons from SVG files:
xmlns:svg="http://mindfusion.eu/svg/wpf"
<DataTemplate DataType="{x:Type vk:RegularKey}">
...
<Image Source="{svg:SvgDrawing Source=/resource_icon.svg}" .../>
...
</DataTemplate>
Miscellaneous- The Image setter of Key objects no longer changes the specified value to an absolute path relative to current executable. The KeyImageConverter lets you revert to that behavior if binding to loose image files.
- Keyboard Creator fixes.
- New color schemes in Themes.dll resource dictionary.
The latest version can be downloaded here, or from the
clients area on our site:
https://mindfusion.eu/KeyboardWpf.zipUpdated assemblies are also available as
MindFusion.Keyboard.Wpf NuGet package.
Enjoy!