mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-06-28 13:34:09 +08:00
29 lines
619 B
C#
29 lines
619 B
C#
using CPF.Controls;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CPF.Toolkit.Demo
|
|
{
|
|
internal class MainViewModel : ViewModelBase
|
|
{
|
|
bool isClose = false;
|
|
public void Test()
|
|
{
|
|
if (this.Dialog.Ask("确定要关闭吗") == "确定")
|
|
{
|
|
this.isClose = true;
|
|
this.Close();
|
|
}
|
|
}
|
|
|
|
protected override void OnClose(ClosingEventArgs e)
|
|
{
|
|
e.Cancel = !this.isClose;
|
|
base.OnClose(e);
|
|
}
|
|
}
|
|
}
|