#pragma once #include #include #include #include #include using namespace winrt::Windows::Foundation; namespace Dialog { template KeyboardManagerHelper::ErrorType CheckIfRemappingsAreValid( const std::vector>& remappings, std::function isValid) { KeyboardManagerHelper::ErrorType isSuccess = KeyboardManagerHelper::ErrorType::NoError; std::set ogKeys; for (int i = 0; i < remappings.size(); i++) { T ogKey = remappings[i][0]; T newKey = remappings[i][1]; if (isValid(ogKey) && isValid(newKey) && ogKeys.find(ogKey) == ogKeys.end()) { ogKeys.insert(ogKey); } else if (isValid(ogKey) && isValid(newKey) && ogKeys.find(ogKey) != ogKeys.end()) { isSuccess = KeyboardManagerHelper::ErrorType::RemapUnsuccessful; } else { isSuccess = KeyboardManagerHelper::ErrorType::RemapUnsuccessful; } } return isSuccess; } IAsyncOperation PartialRemappingConfirmationDialog(winrt::Windows::UI::Xaml::XamlRoot root); };