-2

I'm developing a simple windows 10 utility app using C# & WinUi 3. So the main component of my app is the Expander component/control. My problem is that the Expander control is not found. It's not found in the Windows.UI.Xaml.Controls namespace.

I'm using Visual Studio 2019.

I followed the documentation step by step but it didn't work.

Installed Packages are:

enter image description here

enter image description here

enter image description here

enter image description here

This is the message I got:

enter image description here

Ali BEN AMOR
  • 126
  • 1
  • 6
  • WinUI3 classes are not in the Windows.* namespace but in the Microsoft.* ones (yeah, it can be confusing): https://learn.microsoft.com/en-us/windows/apps/design/controls/expander https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.expander?view=windows-app-sdk-1.1 – Simon Mourier Jun 20 '22 at 12:13
  • Thanks for you response. i checked the namespace Microsoft.UI.Xaml.Controls; as well but I couldn't find the Expander class. – Ali BEN AMOR Jun 20 '22 at 12:24
  • I don't know how you installed WinUI3 but it's definitely there: Microsoft.UI.Xaml.Controls.Expander – Simon Mourier Jun 20 '22 at 12:25
  • As I mentioned I installed WinUI3 through the Visual Studio 2019 Installer. following the official documentation. – Ali BEN AMOR Jun 20 '22 at 12:48
  • Judging by your screenshots, you have *not* followed the documentation. – mm8 Jun 20 '22 at 14:11
  • @mm8 can you explain how ? please. – Ali BEN AMOR Jun 21 '22 at 12:39

1 Answers1

-2

I've installed Visual Studio 2022 and it's finally working.

Ali BEN AMOR
  • 126
  • 1
  • 6