ghost1372 / HandyControls

Contains some simple and commonly used WPF controls based on HandyControl
https://ghost1372.github.io/
MIT License
1.1k stars 104 forks source link

Custom YesNoCancel MessageBox's close button return Yes result #157

Closed CodingOctocat closed 2 years ago

CodingOctocat commented 2 years ago

Describe the bug

result = HCMessageBox.Show(
    new MessageBoxInfo() {
        Message = "是否要保存?",
        Caption = App.APP_NAME,
        Button = MessageBoxButton.YesNoCancel,
        IconKey = ResourceToken.WarningGeometry,
        IconBrushKey = ResourceToken.AccentBrush,
        DefaultResult = MessageBoxResult.Yes,
        YesContent = "保存",
        NoContent = "不保存",
        CancelContent = "取消",
        ConfirmContent = "???" // By the way, What is it? I did not see any effect.
    });

If i click [X] close button, the result is Yes,It should return the Cancel.

Steps to reproduce the bug

  1. Create a custom YesNoCancel MessageBox
  2. Close the MessageBox
  3. The result is Yes, Expected is Cancel

Expected behavior

No response

Screenshots

No response

NuGet package version

HandyControls (Custom version) 3.4.0

IDE

Visual Studio 2022

Framework type

.Net 6.0

Windows version

Windows 11 (22000)

Additional context

No response

ghost1372 commented 2 years ago

report it in Original repo http://github.com/handyorg/handycontrol