0

I created a new blank Windows 10 Universal app and tried to add a WrapPanel exactly as per the sample code in the link: WrapPanel XAML Control

I am getting the following error message on wrapPanel:WrapPanel

The name "WrapPanel" does not exist in the namespace "using:Microsoft.Toolkit.Uwp.UI.Controls.WrapPanel"

I have already added xmlns:wrapPanel="using:Microsoft.Toolkit.Uwp.UI.Controls.WrapPanel" as per sample code.

Full code and errors (please click image for better quality):

WrapPanel full code and errors

I have tried to Clean and Build/Rebuild but it doesn't help. I also made sure that I am targeting the latest Windows 10 version:

WrapPanel Target Windows version

Please help!

Update: I tried using xmlns:wrapPanel="using:Microsoft.Toolkit.Uwp.UI.Controls" as suggested but I still get this error. Again, I tried clean and build/rebuild and am getting the a similar error:

WrapPanel Error update

slayernoah
  • 4,382
  • 11
  • 42
  • 73
  • You can download the sample app [here](https://www.microsoft.com/en-us/store/p/uwp-community-toolkit-sample-app/9nblggh4tlcq). It has live examples which will always work, the code for the wrappanel one is [here](https://github.com/Microsoft/UWPCommunityToolkit/blob/master/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/WrapPanel/WrapPanel.bind). – Michael Hawker - MSFT Feb 28 '18 at 01:13
  • @MichaelHawker-MSFT using the code on github, I am still getting a similar error. please see updated screenshot on the question. thanks for your help! – slayernoah Feb 28 '18 at 14:35

1 Answers1

2

The documentation has a typo. The WrapPanel control is not in the Microsoft.Toolkit.Uwp.UI.Controls.WrapPanel namespace, but rather just in Microsoft.Toolkit.Uwp.UI.Controls, so use the following

xmlns:wrapPanel="using:Microsoft.Toolkit.Uwp.UI.Controls"

And it should work as expected. I will push an update for the docs.

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
  • I am still getting a similar error when i point to `xmlns:wrapPanel="using:Microsoft.Toolkit.Uwp.UI.Controls"` instead as suggested. Please see updated screenshot on the question – slayernoah Feb 28 '18 at 14:34
  • Have you installed the UWP Community Toolkit (Controls) package from NuGet? Could you post a screenshot of references section in the project expanded? – Martin Zikmund Feb 28 '18 at 15:37