public virtual void ShouldSetCorrectDataContextWhenBinding() { Accordion acc = new Accordion(); List<string> MyCollection = new List<string>(); MyCollection.Add("AAAA"); MyCollection.Add("BBBB"); MyCollection.Add("CCCC"); acc.DataContext = MyCollection; acc.SetBinding(Accordion.ItemsSourceProperty, new Binding()); AccordionItem generated = null; TestAsync( acc, () => generated = (AccordionItem) acc.ItemContainerGenerator.ContainerFromIndex(1), () => Assert.IsTrue(generated.Header.ToString() == "BBBB")); }