Beispiel #1
0
        public void MoveSelection_Does_Select_Disabled_Controls()
        {
            // Issue #3426.
            var target = new TestSelector
            {
                Template = Template(),
                Items    = new[]
                {
                    new ListBoxItem(),
                    new ListBoxItem {
                        IsEnabled = false
                    },
                },
                SelectedIndex = 0,
            };

            target.Measure(new Size(100, 100));
            target.Arrange(new Rect(0, 0, 100, 100));
            target.MoveSelection(NavigationDirection.Next, true);

            Assert.Equal(0, target.SelectedIndex);
        }
Beispiel #2
0
        public void MoveSelection_Wrap_Does_Not_Hang_With_No_Focusable_Controls()
        {
            // Issue #3094.
            var target = new TestSelector
            {
                Template = Template(),
                Items    = new[]
                {
                    new ListBoxItem {
                        Focusable = false
                    },
                    new ListBoxItem {
                        Focusable = false
                    },
                },
                SelectedIndex = 0,
            };

            target.Measure(new Size(100, 100));
            target.Arrange(new Rect(0, 0, 100, 100));
            target.MoveSelection(NavigationDirection.Next, true);
        }