Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在第二层的MenuItem中调用OverlayDialog时,对话框闪烁的问题 #250

Open
satanikia1300 opened this issue May 28, 2024 · 1 comment

Comments

@satanikia1300
Copy link

问题:

在第二层的MenuItem中调用OverlayDialog时,对话框会先在左上角闪一下再到画面中间。
有Overlay的MessageBox也会。
原因不明,暂时的解决方法是调用前加Task.Delay(1)

环境:

Windows11

版本:

Avalonia 11.1.0-beta2
Semi.Avalonia 11.1.0-beta2
Irihi.Ursa 0.3.0-beta20240518

代码如下:

MainWindow.axaml

<Panel>
    <DockPanel>
        <Menu DockPanel.Dock="Top">
            <MenuItem Header="菜单">
                <MenuItem Click="Button_Click" Header="测试1" />
            </MenuItem>
        </Menu>
        <Button Click="Button_Click" Content="测试2" />
    </DockPanel>
    <u:OverlayDialogHost />
</Panel>

MainWindow.axaml.cs

private async void Button_Click(object? sender, RoutedEventArgs e)
{
    //加延迟可以解决这个问题
    //await Task.Delay(1);
    var ret = await OverlayDialog.ShowModal(null, null);
}
@satanikia1300
Copy link
Author

抱歉之前没发现有加标签。。。
代码和上面一样,更新到目前最新的nuget包了,还是有这个问题。
Avalonia 11.1.3
Irihi.Ursa 1.3.0
Semi.Avalonia 11.1.0.4

1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants