public void ParentTest() { ItemsControl c = new ItemsControl(); FrameworkElement item = new ComboBoxItem(); c.Items.Add(item); Assert.AreSame(c, item.Parent, "#1"); item = new Rectangle(); c.Items.Add(item); Assert.AreSame(c, item.Parent, "#2"); item = new MoonTest.System.Windows.Controls.ContentControlTest.ConcreteFrameworkElement(); c.Items.Add(item); Assert.AreSame(c, item.Parent, "#3"); }
public void ParentTest () { ItemsControl c = new ItemsControl (); FrameworkElement item = new ComboBoxItem (); c.Items.Add (item); Assert.AreSame (c, item.Parent, "#1"); item = new Rectangle (); c.Items.Add (item); Assert.AreSame (c, item.Parent, "#2"); item = new MoonTest.System.Windows.Controls.ContentControlTest.ConcreteFrameworkElement (); c.Items.Add (item); Assert.AreSame (c, item.Parent, "#3"); }