AnsweredAssumed Answered

How do I resolve the error: value of type cannot be added to a collection or dictionary of type 'UIElementCollection'

Question asked by csergent08 Champion on Sep 25, 2015

I have a xaml file with the following code and I receive an error for my local:TextEditorToolbar:

 

Window x:Class="TextEditor.MainWindow"


xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"


xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"


xmlns:local="clr-namespace:TextEditor"


Title="Text Editor" Height="600" Width="800">


<DockPanel>


<Menu x:Name="menu"


DockPanel.Dock="Top"/>



<StackPanel>


<local:TextEditorToolbar x:Name="toolbar"/>


</StackPanel>



<StatusBar DockPanel.Dock="Bottom">


<TextBlock x:Name="status" />


</StatusBar>


<RichTextBox x:Name="body"


SpellCheck.IsEnabled="True"


AcceptsTab="True"


AcceptsReturn="True"


BorderThickness="0 2 0 0" />


</DockPanel>

 

Window>


It references a user control name TextEditorToolbar.xaml. Why would I receive this error and how do I fix it.

 

 

 

 

Outcomes