We have a custom control called FixedToolBar defined in a class library which is referenced by a second assembly which uses it via XAML. However, VS2015 is showing the error:
A value of type FixedToolBar cannot be added to a collection or dictionary of type 'UIElementCollection'
Here's the class itself
public class FixedToolBar : Control // <-- Control is a subclass of UIElement
{
// Bla bla
}
...and here's the XAML snippet...
<DockPanel>
<c:FixedToolBar x:Name="MainToolBar" DockPanel.Dock="Top">
<Button Header="Test 1" />
<Button Header="Test 2" />
</c:FixedToolBar>
<ListBox x:Name="MainListBox" />
</DockPanel>
More odd is it only shows the error when the XAML editor is open, but otherwise compiles and runs just fine!
Any ideas why? It's really annoying to have VS report all these errors at design time. All those red squigglies makes the XAML da@n near unreadable!