Beispiel #1
0
        public void Add(IKeyboardLayout layout)
        {
            Dispatcher.Invoke(() =>
            {
                var button = new ActionCenterKeyboardLayoutButton(layout);

                button.LayoutSelected += Button_LayoutSelected;
                button.CultureCode     = layout.CultureCode;
                button.LayoutName      = layout.Name;

                LayoutsStackPanel.Children.Add(button);
            });
        }
Beispiel #2
0
        private void InitializeLayouts()
        {
            foreach (var layout in keyboard.GetLayouts())
            {
                var button = new ActionCenterKeyboardLayoutButton(layout);

                button.LayoutSelected += (o, args) => ActivateLayout(layout);
                LayoutsStackPanel.Children.Add(button);

                if (layout.IsCurrent)
                {
                    SetCurrent(layout);
                }
            }
        }