title: Wpf Prism event update control
body: <p>I have a standard Listbox which is bound to a property in my viewmodel</p>
  
  <pre><code>   &lt;ListBox ItemsSource="{Binding StatusList, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  Name="myListBox"  BorderThickness="0" HorizontalAlignment="Stretch"&gt;        
                  &lt;/ListBox&gt;
  </code></pre>
  
  <p>The property</p>
  
  <pre><code> private ObservableCollection&lt;String&gt; _statusList;
          public ObservableCollection&lt;String&gt; StatusList
          {
              get { return _statusList;}
              set { _statusList = value;}
          }
  </code></pre>
  
  <p>The view model subscribes to an event</p>
  
  <pre><code>  _eventAggregator.GetEvent&lt;PublishStatusEvent&gt;().Subscribe(this.OnStatusChanged);
  </code></pre>
  
  <p>which excecutes a function that just adds strings to the collection</p>
  
  <pre><code> private void OnStatusChanged(string status)
          {
              StatusList.Add(status);
          }
  </code></pre>
  
  <p>When i exceute a long running task that publishes events , i want the listbox to update. If i debug i can see the events coming but the listbox is not getting updated until the task is finished. The task is inititated in the viewmodel.</p>
  
  <p>Anyone?</p>