Beispiel #1
0
        public void ContainerItemTest5()
        {
            ConceteElement    item = new ConceteElement();
            ItemsControlPoker c    = new ItemsControlPoker();

            c.ApplyTemplate();
            CreateAsyncTest(c, () => {
                c.Items.Add(item);
                Assert.IsNull(c.LastCreatedContainer, "#1");                  // No autogenerated container
                Assert.IsNull(item.DataContext, "#3");
            });
        }
Beispiel #2
0
        public void ContainerItemTest6()
        {
            object            item      = new object();
            ConceteElement    container = new ConceteElement();
            ItemsControlPoker c         = new ItemsControlPoker();

            c.ContainerItem = container;
            c.ApplyTemplate();
            CreateAsyncTest(c, () => {
                c.Items.Add(item);
                Assert.AreEqual(container, c.LastCreatedContainer, "#1");
                Assert.AreEqual(container.DataContext, item, "#2");
                Assert.AreEqual(container.ReadLocalValue(FrameworkElement.DataContextProperty), item, "#3");
            });
        }
Beispiel #3
0
		public void ContainerItemTest6 ()
		{
			object item = new object ();
			ConceteElement container = new ConceteElement ();
			ItemsControlPoker c = new ItemsControlPoker ();
			c.ContainerItem = container;
			c.ApplyTemplate ();
			CreateAsyncTest (c, () => {
				c.Items.Add (item);
				Assert.AreEqual (container, c.LastCreatedContainer, "#1");
				Assert.AreEqual (container.DataContext, item, "#2");
				Assert.AreEqual (container.ReadLocalValue (FrameworkElement.DataContextProperty), item, "#3");
			});
		}
Beispiel #4
0
		public void ContainerItemTest5 ()
		{
			ConceteElement item = new ConceteElement ();
			ItemsControlPoker c = new ItemsControlPoker ();
			c.ApplyTemplate ();
			CreateAsyncTest (c, () => {
				c.Items.Add (item);
				Assert.IsNull (c.LastCreatedContainer, "#1"); // No autogenerated container
				Assert.IsNull (item.DataContext, "#3");
			});
		}