Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Reed Copsey Gave you the complete answer to you question. However, I just want to point out that actually you don't need this in WPF. Usually it is automatically handled when you use MVVM pattern via <code>INotifyPropertyChanged</code> and xaml databinding. In case of synchronizing the collections you could use Multithreaded observable collection. This is the source code I use myself.</p> <pre><code>public class MultiThreadedObservableCollection&lt;T&gt; : ObservableCollection&lt;T&gt; { public override event NotifyCollectionChangedEventHandler CollectionChanged; public MultiThreadedObservableCollection() { } public MultiThreadedObservableCollection(IEnumerable&lt;T&gt; source) : base(source) { } public MultiThreadedObservableCollection(List&lt;T&gt; source) : base(source) { } protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { var handle = CollectionChanged; if (CollectionChanged == null) return; foreach (NotifyCollectionChangedEventHandler handler in handle.GetInvocationList()) { var dispatcherObj = handler.Target as DispatcherObject; if (dispatcherObj != null) { var dispatcher = dispatcherObj.Dispatcher; if (dispatcher != null &amp;&amp; !dispatcher.CheckAccess()) { dispatcher.BeginInvoke( (Action)(() =&gt; handler.Invoke( this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)) ), DispatcherPriority.DataBind); continue; } } handler.Invoke(this, e); } } } </code></pre> <p>(It comes somewhere from here, stackoverflow.com but couldn't find the source, by now)</p> <p>Then you simply define your ViewModels and start changing the values. This is the most suitable, right and fast way of developing WPF applications.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload