I have a WPF UserControl with referenced link converters:
<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"> <UserControl.Resources> <local:ConfidenceColorConverter x:Key="ConfidenceColorConverter"/> </UserControl.Resources>
Then I use the binding converter later. I see a user control in my design window. Then I compile and then put this control in the main window. I run it and it works. However, I would still like to use the constructor in the main window, which breaks:
Failed to create an instance of type MyControl.
So, I learned how to debug a constructor ; when I do this, I get a XamlParseException:
Cannot find type "TheMainNamespaceOfThisAssembly.ConfidenceColorConverter". The assembly used at compilation may differ from that used at boot, but the type is missing. Error in markup file ...
If you delete the links to the converters, my user control will be displayed in the designer in the main window. Any ideas how to fix my converter links so that they don't break the constructor?
Failed to figure out if the article Troubleshooting WPF Designer Boot Errors is applicable.
source share