question

XiaoLi8848-5499 avatar image
0 Votes"
XiaoLi8848-5499 asked XiaopoYang-MSFT answered

WinUI 3(C++/WinRT): "NavViewCompactModeThresholdWidth" not found

According to the sample code of the the document in Microsoft Docs, 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?
MainWindow.idl
ProjectName.h


windows-apic++windows-app-sdk-winui3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

XiaopoYang-MSFT avatar image
0 Votes"
XiaopoYang-MSFT answered

According to the linked document, your MainWindow header and source file should have a function named NavViewCompactModeThresholdWidth.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.