private void HighlightSelectedKey(KeyboardKey key) { foreach (var b in keyboard.KeyViews) { b.ClearValue(BorderBrushProperty); b.ClearValue(BackgroundProperty); } var btn = keyboard[key.IsoCode]; btn.BorderBrush = SystemColors.HighlightBrush; btn.Background = SystemColors.HighlightBrush; }
internal Button GenerateKeyView(KeyboardKey key) { var btn = new Button(); if (key.Type == EKeyType.Shift) { btn.Content = "Shift"; } else { btn.Content = key.IsoCode; } btn.Width = 32.0 * key.Weight; btn.Height = 32; btn.Margin = new Thickness(4); btn.Tag = key; return(btn); }
public SetSelectedKey(KeyboardKey key) { Value = key; }