Beispiel #1
0
        public void RefreshDescendants_DoesNotLoadUnloadedProperties()
        {
            var root = new RootVM();

            root.RefreshDescendants(b => {
                b.Descendant(x => x.Children)
                .Properties(x => x.RefreshDetectionProperty);
            });

            ViewModelAssert.IsNotLoaded(root, x => x.Children);
        }
Beispiel #2
0
        public void Refresh_RefresesSelectedDescendants()
        {
            var root  = new RootVM();
            var child = new ChildVM();
            var item1 = new ChildVM();

            root.Child = child;
            root.Children.Add(item1);

            root.RefreshDescendants(b => {
                b.Descendant(x => x.Children)
                .Properties(x => x.RefreshDetectionProperty);
            });

            Assert.IsTrue(item1.WasRefreshed);
            Assert.IsFalse(child.WasRefreshed);
        }