Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Opening the PresentationFramework.dll within Reflector and looking at System.Windows.Controls.ItemsControl showed the following:</p> <pre><code>public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(ItemsControl), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(ItemsControl.OnItemsSourceChanged))); private static void OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ItemsControl control = (ItemsControl) d; IEnumerable oldValue = (IEnumerable) e.OldValue; IEnumerable newValue = (IEnumerable) e.NewValue; ItemValueStorageField.ClearValue(d); if ((e.NewValue == null) &amp;&amp; !BindingOperations.IsDataBound(d, ItemsSourceProperty)) { control.Items.ClearItemsSource(); } else { control.Items.SetItemsSource(newValue); } control.OnItemsSourceChanged(oldValue, newValue); } </code></pre> <p>Not knowing what <code>RefreshLayout</code> does my hunch is that it has something to do with the way the <code>ObservableCollection&lt;T&gt;</code> is being wrapped as the above code is oblivious to what the concrete collection type is and it would therefore be handled by the type being wrapped; in this case an <code>ObservableCollection&lt;T&gt;</code> Try modifying your property as seen below to return the default view and adjust your <code>ItemsSource</code> property to be more akin to the above code from the framework and work backwards from there.</p> <pre><code>private ObservableCollection&lt;Controls.EventCalendar.EventItem&gt; eventItems; private ICollectionview eventsView; public System.ComponentModel.ICollectionView Events { get { if (eventsView == null) eventsView = CollectionViewSource.GetDefaultView(eventItems); return eventsView; } } </code></pre>
 

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