Alex Rivera | Logout

A value of type '...' cannot be added to a collection or dictionary of type 'UIElementCollection'

Asked 2011-04-28T06:38:34.397
32

I am getting the following error when I am adding a custom control via XAML. What can be the possible reason?

A value of type '...' cannot be added to a collection or dictionary of type 'UIElementCollection'

<Grid x:Name="QuantityDetail" DataContext="{StaticResource ViewModel}">
    <GroupBox>
       .....
       <Label Style="{StaticResource ResourceKey=LabelValue}">Min</Label>
       <!-- The following control -->
       <NumericUpDown></NumericUpDown>
       .....
    </GroupBox>
</Grid>
           
Edit
Report

1 Answer

3

The compiler claims that your control is not an UIElement (i doubt that it is lying), what does your control inherit from?

answered 2011-04-28T07:15:47.947

Your Answer