WindowsAppSDK-Samples icon indicating copy to clipboard operation
WindowsAppSDK-Samples copied to clipboard

Windowing - TitleBar sample - Titlebar always null

Open tinmac opened this issue 4 years ago • 2 comments

If we navigate to the 'Titlebar' page, pressing any of the three buttons results in a null ref exception:

image

Code is unaltered & run from fresh clone of this repo.

WinUI project.

I note you refer to this as being fixed in #71 and #94 but it doesnt seem to be @samanthamsong, can you provide any guidance?

tinmac avatar Oct 28 '21 17:10 tinmac

I can confirm I am experiencing this too. I get the window handle, then I get the Window id and get the AppWindow from window Id. AppWindow is there and working fine, but it's TitleBar is always null.

MahmudOnWeb avatar Oct 29 '21 23:10 MahmudOnWeb

AppWindow titlebar APIs, including ResetToDefault , work only on Windows 11 builds. There's an error in the sample which I will correct. AppWindowTitleBar. IsCustomizationSupported has to return true for me to call ResetToDefault successfully. Titlebar object is null on Windows 10 and earlier versions. We are working to bring this functionality downlevel in upcoming releases. I'll update the sample accordingly.

mevey avatar Nov 12 '21 22:11 mevey

The sample has been updated to use WindowsAppSDK 1.2. Also, the AppWindow APIs have been ported to downlevel. If you still see this issue, reactivate with your updated results.

bpulliam avatar Nov 12 '22 11:11 bpulliam