-
-
Notifications
You must be signed in to change notification settings - Fork 464
/
AppCloseSaveReminderDialog.cs
29 lines (26 loc) · 1.49 KB
/
AppCloseSaveReminderDialog.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// ---------------------------------------------------------------------------------------------
// Copyright (c) 2019-2024, Jiaqi (0x7c13) Liu. All rights reserved.
// See LICENSE file in the project root for license information.
// ---------------------------------------------------------------------------------------------
namespace Notepads.Controls.Dialog
{
using System;
using Windows.UI;
using Windows.UI.Xaml;
public sealed class AppCloseSaveReminderDialog : NotepadsDialog
{
public AppCloseSaveReminderDialog(Action saveAndExitAction, Action discardAndExitAction, Action cancelAction)
{
Title = ResourceLoader.GetString("AppCloseSaveReminderDialog_Title");
HorizontalAlignment = HorizontalAlignment.Center;
Content = ResourceLoader.GetString("AppCloseSaveReminderDialog_Content");
PrimaryButtonText = ResourceLoader.GetString("AppCloseSaveReminderDialog_PrimaryButtonText");
SecondaryButtonText = ResourceLoader.GetString("AppCloseSaveReminderDialog_SecondaryButtonText");
CloseButtonText = ResourceLoader.GetString("AppCloseSaveReminderDialog_CloseButtonText");
PrimaryButtonStyle = GetButtonStyle(Color.FromArgb(255, 38, 114, 201));
PrimaryButtonClick += (dialog, eventArgs) => saveAndExitAction();
SecondaryButtonClick += (dialog, eventArgs) => discardAndExitAction();
CloseButtonClick += (dialog, eventArgs) => cancelAction();
}
}
}