#pragma once #include #include #include class ShortcutControl { private: // Textblock to display the selected shortcut TextBlock shortcutText; // Button to type the shortcut Button typeShortcut; // StackPanel to parent the above controls StackPanel shortcutControlLayout; public: // Handle to the current Edit Shortcuts Window static HWND EditShortcutsWindowHandle; // Pointer to the keyboard manager state static KeyboardManagerState* keyboardManagerState; ShortcutControl() { typeShortcut.Content(winrt::box_value(winrt::to_hstring("Type Shortcut"))); typeShortcut.Click([&](IInspectable const& sender, RoutedEventArgs const&) { keyboardManagerState->SetUIState(KeyboardManagerUIState::DetectShortcutWindowActivated, EditShortcutsWindowHandle); // Using the XamlRoot of the typeShortcut to get the root of the XAML host createDetectShortcutWindow(sender, sender.as