Beispiel #1
0
        public void Properties() => Create(vm =>
        {
            var view = new ScrollViewer {
                DataContext = vm
            };
            var src = new VisibleRange();

            src.Attach(view);
            Assert.That(src.First, Is.EqualTo(0));
            Assert.That(src.Last, Is.EqualTo(0));
            Assert.That(src.Unit, Is.EqualTo(0));
            src.Detach();
        });
Beispiel #2
0
        public void Invoke()
        {
            var view = new ScrollViewer();
            var src  = new VisibleRange();

            Assert.That(view.ActualWidth, Is.EqualTo(0), nameof(view.ActualWidth));
            Assert.That(view.ActualHeight, Is.EqualTo(0), nameof(view.ActualHeight));
            src.Attach(view);

            Assert.That(src.First, Is.EqualTo(0), nameof(src.First));
            Assert.That(src.Last, Is.EqualTo(0), nameof(src.Last));
            Assert.That(src.Unit, Is.EqualTo(0), nameof(src.Unit));
            src.Unit = 100;
            Assert.That(src.First, Is.EqualTo(0), nameof(src.First));
            Assert.That(src.Last, Is.EqualTo(3), nameof(src.Last));
            Assert.That(src.Unit, Is.EqualTo(100), nameof(src.Unit));

            src.Detach();
        }