tags:

views:

73

answers:

2

Hi i am using this code in myClass to change content in my wpf applciation

      public event PropertyChangedEventHandler PropertyChanged;
  protected void Notify(string propertyName)
  {
     if (this.PropertyChanged != null)
     {
        PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
     }
  }

Everytime i change a property in myClass it changes the labels that i have in my app.

 <Label Content="{Binding Category}" Padding="7,0,0,0" />

this works just fine but in myClass i have an property contains an ilist to another class Article

private IList<Article> m_articles = new List<Article>();

Now to myquestion the Notify method doesnt update the content in my the Ilist is there i way to make it update with an ilist and view. All property in myclass works fine if it is an string or int but when it is a Ilist it wont update. Hope you guys understand what i mean my english is bad sry.. Thanks for help

here the code in xaml

                            <ListBox Name="ArtInfo" ItemsSource="{Binding Path=Articles}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Label Content="{Binding Artnr}" />
                                </DataTemplate>
                            </ListBox.ItemTemplate>

{Binding Path=Articles} <-- this is the property that contains an ilist <-- this is an property in the Article class

+5  A: 

You should use an ObservableCollection<Article> instead of a List<Article>

Thomas Levesque
A: 

Thanks that worked!!!!