示例#1
0
        public void ToggleExtent_Backward()
        {
            var collection = new VirtualCollection(10);
            var selection  = new AsyncDataGridRowSelection(collection);

            selection.ToggleSingle(5);
            selection.ToggleSingle(3, true);
            int selectionChanged = 0;

            selection.SelectionChanged += (s, e) => ++ selectionChanged;

            selection.ToggleExtent(1);

            Assert.Equal(R(1, 4), selection.GetSnapshot());
            Assert.Equal(1, collection.FocusIndex);
            Assert.Equal(1, selectionChanged);
        }
示例#2
0
        public void ToggleSingle_Extend()
        {
            var collection = new VirtualCollection(10);
            var selection  = new AsyncDataGridRowSelection(collection);

            selection.Select(5);
            int selectionChanged = 0;

            selection.SelectionChanged += (s, e) => ++ selectionChanged;

            selection.ToggleSingle(2, true);
            selection.ToggleSingle(3, true);

            Assert.Equal(R(2, 4, 5, 6), selection.GetSnapshot());
            Assert.Equal(3, collection.FocusIndex);
            Assert.Equal(2, selectionChanged);
        }