Property 'Items' not registered for type 'ContainerData'
Posted: 07 Oct 2013, 17:03
I'm getting this error when trying to raise the property changed event.
ContainerData is my class which ultimately inherits from BaseComponent. It has the property Items, which is a list of ItemData (ItemData also inherits from BaseComponent). I set the datacontext to an instance of ContainerData, in my start function.
Here is my xaml:
As you can see, the listview binds to my items collection, and the first column displays the ItemName. Property notification works fine with simple properties, but seems to have issues when I add items to the collection, via this:
My ItemData item also has property notification. Anyway...a little confused as to why this is failing, any direction is most appreciated
ContainerData is my class which ultimately inherits from BaseComponent. It has the property Items, which is a list of ItemData (ItemData also inherits from BaseComponent). I set the datacontext to an instance of ContainerData, in my start function.
Here is my xaml:
Code: Select all
<ListView ItemsSource="{Binding Path=Items}">
<ListView.View>
<GridView>
<GridViewColumn Width="200" Header="Item" DisplayMemberBinding="{Binding Path=ItemName}" />
<GridViewColumn Header="Quality"/>
<GridViewColumn Width="60" Header="Amount"/>
<GridViewColumn Header="Damage"/>
</GridView>
</ListView.View>
</ListView>Code: Select all
public void AddItem(ItemData item)
{
_Items.Add(item);
NotifyPropertyChanged("Items");
}My ItemData item also has property notification. Anyway...a little confused as to why this is failing, any direction is most appreciated