lepoco / wpfui

WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
https://wpfui.lepo.co
MIT License
7.68k stars 750 forks source link

[Bug] MessageBox Topmost should not be mandatory #1197

Open emako opened 3 months ago

emako commented 3 months ago

Describe the bug

Topmost should not be mandatory. MessageBox Topmost should be inherited from owner when owner is not null.

To Reproduce

/

Expected behavior

/

Screenshots

image

OS version

/

.NET version

.NET8

WPF-UI NuGet version

<PackageReference Include="WPF-UI" Version="3.0.4" />

Additional context

/

textGamex commented 3 months ago

可以描述一下需要从Owner继承Topmost的使用场景吗?

emako commented 3 months ago

可以描述一下需要从Owner继承Topmost的使用场景吗?

这跟WPF的System.Windows.MessageBox.Show的工作方式一样,会自动继承owner的Topmost。 This works the same way as WPF's System.Windows.MessageBox.Show, which automatically inherits the owner's Topmost.

Test code:

        private void NormalButton_Click(object sender, RoutedEventArgs e)
        {
            Topmost = false;
            MessageBox.Show(this, "MessageBox will not be Topmost");
        }

        private void TopmostButton_Click(object sender, RoutedEventArgs e)
        {
            Topmost = true;
            MessageBox.Show(this, "MessageBox will be Topmost");
        }

code files: WpfApp1.zip