PowerToys/src/modules/keyboardmanager/ui/Dialog.cpp
Chakib Ljazouli 3272575f70
Dynamic dialog titles for Key/Shortcuts remapping (#4251)
* Fix typo in dialog title

* Pass Remap Keys/Shortcuts dialog titles as argument
2020-06-23 20:00:58 -07:00

18 lines
727 B
C++

#include "pch.h"
#include "Dialog.h"
IAsyncOperation<bool> Dialog::PartialRemappingConfirmationDialog(XamlRoot root, std::wstring dialogTitle)
{
ContentDialog confirmationDialog;
confirmationDialog.XamlRoot(root);
confirmationDialog.Title(box_value(dialogTitle));
confirmationDialog.IsPrimaryButtonEnabled(true);
confirmationDialog.DefaultButton(ContentDialogButton::Primary);
confirmationDialog.PrimaryButtonText(winrt::hstring(L"Continue Anyway"));
confirmationDialog.IsSecondaryButtonEnabled(true);
confirmationDialog.SecondaryButtonText(winrt::hstring(L"Cancel"));
ContentDialogResult res = co_await confirmationDialog.ShowAsync();
co_return res == ContentDialogResult::Primary;
}