示例#1
0
        public void Remove_Existing_ChildRemovedAndCollectionChangedTriggered()
        {
            int             collectionChangedCount = 0;
            CanvasContainer container = new CanvasContainer();
            CanvasObject    co        = new ButtonObject();

            container.Add(co);
            container.CollectionChanged += (sender, e) => collectionChangedCount++;

            container.Remove(co);

            Assert.AreEqual(1, collectionChangedCount);
            Assert.AreEqual(0, container.Count);
        }