public void ItemsSource_ResetEvent() { var list = new ManualINCC(); CurrentControl.ItemsSource = list; CreateAsyncTest((FrameworkElement)CurrentControl, () => CurrentControl.ApplyTemplate(), () => { list.AddRange(new [] { new object(), new object() }); list.RaiseINCC(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); Assert.AreEqual(2, CurrentControl.Items.Count, "#1"); } ); }
public virtual void ChangeContainerStyle() { Selector selector = (Selector)CurrentControl; Style first = new Style(typeof(ListBoxItem)); ListBoxItem item = (ListBoxItem)CreateContainer(); item.Content = "A"; Enqueue(() => TestPanel.Children.Add(selector)); Enqueue(() => CurrentControl.ApplyTemplate()); Enqueue(() => { if (CurrentControl is ComboBox) { ((ComboBox)CurrentControl).IsDropDownOpen = true; } }); Enqueue(() => CurrentControl.Items.Add(item)); Enqueue(() => CurrentControl.ItemContainerStyle = first); }