Exemplo n.º 1
0
		public void OffsetInScrollViewerCanContentScrollInWindowWithChildren ()
		{
			Window w = new Window ();
			ScrollViewer v = new ScrollViewer ();
			w.Content = v;
			w.Show ();
			v.CanContentScroll = true;
			StackPanel p = new StackPanel ();
			w.Width = 100;
			w.Height = 100;
			for (int i = 0; i < 10; i++) {
				global::System.Windows.Controls.Button b = new global::System.Windows.Controls.Button ();
				b.Content = "Test";
				p.Children.Add (b);
			}
			v.Content = p;
			Assert.AreEqual (p.HorizontalOffset, 0, "1");
			Assert.AreEqual (p.VerticalOffset, 0, "2");
			p.SetHorizontalOffset (1);
			Assert.AreEqual (p.HorizontalOffset, 0, "3");
			p.SetVerticalOffset (1);
			Assert.AreEqual (p.VerticalOffset, 0, "4");
			p.SetHorizontalOffset (-1);
			Assert.AreEqual (p.HorizontalOffset, 0, "5");
			p.SetVerticalOffset (-1);
			Assert.AreEqual (p.VerticalOffset, 0, "6");
		}
Exemplo n.º 2
0
		public void OffsetInScrollViewer ()
		{
			ScrollViewer v = new ScrollViewer ();
			StackPanel p = new StackPanel ();
			v.Content = p;
			Assert.AreEqual (p.HorizontalOffset, 0, "1");
			Assert.AreEqual (p.VerticalOffset, 0, "2");
			p.SetHorizontalOffset (1);
			Assert.AreEqual (p.HorizontalOffset, 0, "3");
			p.SetVerticalOffset (1);
			Assert.AreEqual (p.VerticalOffset, 0, "4");
			p.SetHorizontalOffset (-1);
			Assert.AreEqual (p.HorizontalOffset, 0, "5");
			p.SetVerticalOffset (-1);
			Assert.AreEqual (p.VerticalOffset, 0, "6");
		}
Exemplo n.º 3
0
		public void OffsetInScrollViewerCanContentScrollInWindow ()
		{
			Window w = new Window ();
			ScrollViewer v = new ScrollViewer ();
			w.Content = v;
			w.Show ();
			v.CanContentScroll = true;
			StackPanel p = new StackPanel ();
			v.Content = p;
			Assert.AreEqual (p.HorizontalOffset, 0, "1");
			Assert.AreEqual (p.VerticalOffset, 0, "2");
			p.SetHorizontalOffset (1);
			Assert.AreEqual (p.HorizontalOffset, 0, "3");
			p.SetVerticalOffset (1);
			Assert.AreEqual (p.VerticalOffset, 0, "4");
			p.SetHorizontalOffset (-1);
			Assert.AreEqual (p.HorizontalOffset, 0, "5");
			p.SetVerticalOffset (-1);
			Assert.AreEqual (p.VerticalOffset, 0, "6");
		}
Exemplo n.º 4
0
		public void Offset ()
		{
			StackPanel p = new StackPanel ();
			Assert.AreEqual (p.HorizontalOffset, 0, "1");
			Assert.AreEqual (p.VerticalOffset, 0, "2");
			p.SetHorizontalOffset (1);
			Assert.AreEqual (p.HorizontalOffset, 0, "3");
			p.SetVerticalOffset (1);
			Assert.AreEqual (p.VerticalOffset, 0, "4");
			p.SetHorizontalOffset (-1);
			Assert.AreEqual (p.HorizontalOffset, 0, "5");
			p.SetVerticalOffset (-1);
			Assert.AreEqual (p.VerticalOffset, 0, "6");
		}