Share via

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

XiaoLi8848 1 Reputation point
2021-08-25T13:42:38.613+00:00

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?
MainWindow.idl
ProjectName.h

Windows development | Windows App SDK
Windows development | Windows API - Win32
Developer technologies | C++
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.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Xiaopo Yang - MSFT 12,736 Reputation points Microsoft External Staff
    2021-08-26T03:18:02.72+00:00

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

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.