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

How do I know when the UWP CoreWindow Window position changes? #9896

Closed
Gaoyifei1011 opened this issue Aug 14, 2024 · 1 comment
Closed

How do I know when the UWP CoreWindow Window position changes? #9896

Gaoyifei1011 opened this issue Aug 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Gaoyifei1011
Copy link

Gaoyifei1011 commented Aug 14, 2024

Describe the bug

How do I know when the UWP CoreWindow Window position changes?
如何知道 UWP CoreWindow 窗口位置发生变化?

My UWP application uses the default download box of WebView2, but the position of the default download box does not move when the position of the WebView2 download box changes, so I want to turn off the default download box of WebView2 when the position of the UWP CoreWindow window changes. I did not find the corresponding event in UWP CoreWindow to get the position dynamics of the window, is there any feasible solution?
我的 UWP 应用使用到了 WebView2 的默认下载框,然而 WebView2 下载框在窗口位置发生变化时,默认下载框的位置却没有移动,所以我想在 UWP CoreWindow 的窗口位置发生变化时关掉 WebView2 的默认下载框。我在 UWP CoreWindow 并没有找到相应的事件来获取窗口的位置动态,请问有什么可行的解决方案吗?

CoreWindow API Documents
CoreWindow API 文档
https://learn.microsoft.com/zh-cn/uwp/api/windows.ui.core.corewindow?view=winrt-26100

{4858EFA9-97AC-46DA-ACD5-8D83784A74D1}

Steps to reproduce the bug

See describe

Expected behavior

Please provide a feasible solution
请提供一个可行的解决方案

Screenshots

image

NuGet package version

WinUI 2 - Microsoft.UI.Xaml 2.8.2

Windows version

Windows Insider Build (xxxxx), Windows 11 (22H2): Build 22621

Additional context

Windows 11 26100

@Gaoyifei1011 Gaoyifei1011 added the bug Something isn't working label Aug 14, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Aug 14, 2024
@codendone
Copy link
Contributor

CoreWindow does not raise any events when its position changes. If this is an important issue, you could start a regular timer which polls CoreWindow.Bounds and checks if the position has changed.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the needs-triage Issue needs to be triaged by the area owners label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants