According to the linked document, your MainWindow header and source file should have a function named NavViewCompactModeThresholdWidth.
WinUI 3(C++/WinRT): "NavViewCompactModeThresholdWidth" not found
According to the sample code of the the document in Microsoft Learn, I wrote almost the same code, but it cannot be compiled. There is an error, "NavViewCompactModeThresholdWidth": is not a member of "winrt::ProjectName::implementation::MainWindow" (compiled source file App.xaml.cpp), it seems that the definition of this member should be located in MainWindow.idl, but I have followed The members of this Double type are defined as written in the document, so how can I eliminate this error?
Windows development | Windows App SDK
Windows development | Windows API - Win32
Developer technologies | C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
1 answer
Sort by: Most helpful
-
Xiaopo Yang - MSFT 12,736 Reputation points Microsoft External Staff
2021-08-26T03:18:02.72+00:00