title: Why do I get FreezableCollection`1 is not a valid value in the XAML designer
body: <p>I am trying to use Nish Nishant's classes to extend the system menu of a WPF window. Nish's project is in Code Project as <a href="https://www.codeproject.com/Articles/70568/An-MVVM-friendly-approach-to-adding-system-menu-en" rel="nofollow noreferrer">An MVVM friendly approach to adding system menu entries in a WPF application</a></p>
  <p>I have included Nish's source files in my project and defined some menu commands for the system menu.</p>
  <p>This was easy and as far as I can tell it is working correctly. I am not getting a runtime error.</p>
  <p>However, the XAML designer is showing me the error</p>
  <blockquote>
  <p>'System.Windows.FreezableCollection`1[NS.MVVM.SystemMenuItem]' is not a valid value for property 'MenuItems'.</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/aUUuR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aUUuR.png" alt="enter image description here" /></a></p>
  <p>This error only appears after compiling the project. I do not get the error in Nish's sample project. I am using Visual Studio 2019 version 16.8.3. What might be causing this error message?</p>
  <p><strong>EDIT</strong></p>
  <p>I now know what is causing the error message, in the sense that I know what the difference is between my project and Nish's sample project.</p>
  <p><em>Nish's project targets the <strong>x86</strong> platform, whereas my project targeted <strong>Any CPU</strong>.</em></p>
  <p>This is understandable, because the code uses Win32 API functions. I have changed the target platform for my project to <strong>x86</strong> and the error has gone.</p>
  <p>However, I still don't really understand why the error occurs and how it relates to the underlying issue of target platform.</p>