Open TRadigk opened 1 year ago
Revisiting the issue today and testing with WASDK 1.4.230628000-preview1 - issue persists.
But I have to add, this issue only exists for non-packaged apps. On packaged apps the issue is not present.
The issue was introduced with 1.2.230217.4.
Testing this issue always requires to clean bin and obj folders in project manually, Visual Studio cleaning is insufficient and can reproduce wrong results.
workaround (and possible root cause):
add this external method to window class:
[DllImport("dwmapi.dll")]
public static extern int DwmSetWindowAttribute(IntPtr hwnd, int attribute, ref int value, int size);
Then add this code e.g. to constructor:
int cornerPreference = 2;
//DWMWA_WINDOW_CORNER_PREFERENCE is documented to have a value of 33
var windowHandle = WinRT.Interop.WindowNative.GetWindowHandle(this);
DwmSetWindowAttribute(windowHandle, 33, ref cornerPreference, Marshal.SizeOf<int>());
Describe the bug
Dear WinUI developers,
the following code produces a window with CornerRadius = 0 (visible, I don't know how to read the value programmatically):
using following nugets:
Also the window looks borderless:
Reproduction code here
Setting
IsResizable = true
re-enables the CornerRadius.Note: The results also show more inconsistencies regarding the border which should show the accent color (set to green).
Reverting to following nugets, does not show this behaviour:
This is independent of net6.0 or .net7.0 but for sure Windows 11 related, since only Windows 11 supports corner radius on windows.
Steps to reproduce the bug
Expected behavior
The CornerRadius and the border remain untouched, as in previous WASDK release(s)
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK Preview 1: 1.3.230228005-preview1
Windows version
Windows 11 (22H2): Build 22621
Additional context
Code for reproduction provided in summary of issue.