mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-24 05:35:00 +00:00
style<Welcome>: replace system message dialog with a custom one
This commit is contained in:
parent
5434629f4c
commit
a9bc0fec21
4 changed files with 123 additions and 9 deletions
33
src/Views/ConfirmDialog.xaml.cs
Normal file
33
src/Views/ConfirmDialog.xaml.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace SourceGit.Views {
|
||||
|
||||
/// <summary>
|
||||
/// 通用的确认弹出框
|
||||
/// </summary>
|
||||
public partial class ConfirmDialog : Controls.Window {
|
||||
private Action cbOK;
|
||||
private Action cbCancel;
|
||||
|
||||
public ConfirmDialog(string title, string message, Action onOk, Action onCancel = null) {
|
||||
InitializeComponent();
|
||||
|
||||
txtTitle.Text = title;
|
||||
txtMessage.Text = message;
|
||||
|
||||
cbOK = onOk;
|
||||
cbCancel = onCancel;
|
||||
}
|
||||
|
||||
private void OnSure(object sender, RoutedEventArgs e) {
|
||||
cbOK?.Invoke();
|
||||
Close();
|
||||
}
|
||||
|
||||
private void OnQuit(object sender, RoutedEventArgs e) {
|
||||
cbCancel?.Invoke();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue