#pragma once #include class SingleKeyRemapControl { private: // Textblock to display the selected remap key TextBlock singleKeyRemapText; // Button to type the remap key Button typeKey; // StackPanel to parent the above controls StackPanel singleKeyRemapControlLayout; public: // Handle to the current Edit Keyboard Window static HWND EditKeyboardWindowHandle; // Pointer to the keyboard manager state static KeyboardManagerState* keyboardManagerState; SingleKeyRemapControl() { typeKey.Content(winrt::box_value(winrt::to_hstring("Type Key"))); typeKey.Background(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::LightGray() }); typeKey.Foreground(Windows::UI::Xaml::Media::SolidColorBrush{ Windows::UI::Colors::Black() }); typeKey.Click([&](IInspectable const& sender, RoutedEventArgs const&) { keyboardManagerState->SetUIState(KeyboardManagerUIState::DetectSingleKeyRemapWindowActivated, EditKeyboardWindowHandle); // Using the XamlRoot of the typeKey to get the root of the XAML host createDetectKeyWindow(sender, sender.as