You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After updating the C++/WinRT NuGet package to the latest version 2.0.240405.15, certain properties and methods like GetTemplateChild and ProtectedCursor are no longer working as expected. These are worked fine in version 2.0.230706.1 of the C++/WinRT NuGet package, but they now generating build errors in the latest version and not even showing in VS IntelliSense.
Steps to reproduce the bug
1. Create a WinUI 3 project in VS 2022. 2. Ensure the installed NuGet versions match the following. If not, update to the specified versions.
ProtectedCursor is part of IUIElementProtected, which is defined as a protected interface for UIElement. It shouldn't have been part of the public interface generated by C++/WinRT in the first place. GetTemplateChild is similar, where it is part of the IControlProtected interface, which is define as a protected interface for Control. The only real supported way of accessing these is by deriving from a control to customise them.
There is a cheeky but unsuported way to keep doing what you wish to do though, that is querying for these protected interfaces. I believe as<IUIElementProtected>(); or as<IControlProtected>(); should still give access to these members.
Describe the bug
After updating the C++/WinRT NuGet package to the latest version 2.0.240405.15, certain properties and methods like GetTemplateChild and ProtectedCursor are no longer working as expected. These are worked fine in version 2.0.230706.1 of the C++/WinRT NuGet package, but they now generating build errors in the latest version and not even showing in VS IntelliSense.
Steps to reproduce the bug
1. Create a WinUI 3 project in VS 2022.
2. Ensure the installed NuGet versions match the following. If not, update to the specified versions.
3. Add the following code inside the button click handler.
4. Rebuild and run the project.
Expected behavior
The build process should be completed successfully without any errors.
Screenshots
Build Errors:
NuGet package version
Windows App SDK 1.6.3: 1.6.241114003
Packaging type
Packaged (MSIX)
Windows version
Windows 10 version 22H2 (19045, 2022 Update)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: