Ghost1372

everything can be handy

Shortcut

Attributes

Name
Keys
IsInfo
IsError
IsWarning
InfoTitle
InfoToolTip
WarningTitle
WarningToolTip
ErrorTitle
ErrorToolTip
Title
CloseButtonText
PrimaryButtonText
SecondaryButtonText
ContentDialogTitle

Events

Name
CloseButtonClick
PrimaryButtonClick
SecondaryButtonClick

Methods

Name
UpdatePreviewKeys
CloseContentDialog

Example

1
<dev:Shortcut x:Name="MainShortcut" PrimaryButtonClick="OnMainShortcutPrimaryButtonClick" SecondaryButtonClick="OnMainShortcutSecondaryButtonClick" CloseButtonClick="OnMainShortcutCloseButtonClick"/>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
MainShortcut.Keys = new List<object>() { "Win", "Alt", "F1" };

private void OnMainShortcutPrimaryButtonClick(object sender, ContentDialogButtonClickEventArgs e)
{
MainShortcut.UpdatePreviewKeys();
MainShortcut.CloseContentDialog();
// "Primary button clicked!" + Environment.NewLine + string.Join(" + ", MainShortcut.Keys);
}

private void OnMainShortcutSecondaryButtonClick(object sender, ContentDialogButtonClickEventArgs e)
{
// "Secondary button clicked!";
}

private void OnMainShortcutCloseButtonClick(object sender, ContentDialogButtonClickEventArgs e)
{
// "Close button clicked!";
}

Demo

you can run demo and see this feature.

DevWinUI

0%