Note that there are some explanatory texts on larger screens.

plurals
  1. POXAML Designer "cannot find type" when converters are in UserControl.Resources
    primarykey
    data
    text
    <p>I have a WPF UserControl with binding converters referenced like this:</p> <pre><code>&lt;UserControl x:Class="MyControl" x:Name="MyControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:TheMainNamespaceOfThisAssembly"&gt; &lt;UserControl.Resources&gt; &lt;local:ConfidenceColorConverter x:Key="ConfidenceColorConverter"/&gt; &lt;/UserControl.Resources&gt; </code></pre> <p>I then use the binding converter later. I see the user control in my design window. Then I compile, then place this user control in my main window. I run it and it works. However, I still would like to use the designer on the main window, which breaks with: </p> <blockquote> <p>Could not create an instance of type 'MyControl'.</p> </blockquote> <p>So I learned <a href="http://msdn.microsoft.com/en-us/library/bb514636.aspx" rel="nofollow noreferrer">how to debug the designer</a>; when I do, I get an XamlParseException:</p> <blockquote> <p>Cannot find type 'TheMainNamespaceOfThisAssembly.ConfidenceColorConverter'. The assembly used when compiling might be different than that used when loading and the type is missing. Error in markup file...</p> </blockquote> <p>If remove the references to the converters, my user control displays well in the designer on the main window. <strong>Any ideas how to fix my references to the converters so that they won't break the designer?</strong></p> <p>Couldn't understand if the article <a href="http://msdn.microsoft.com/en-us/library/bb546934.aspx#ResourcesatDesignTime" rel="nofollow noreferrer">Troubleshooting WPF Designer Load Failures</a> applies or not.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload