Exemple #1
0
		public void TextBoxScrollable_Wrap_Visible ()
		{
			// If we enable wrapping, the ScrollViewer disables horizontal scrolling even if
			// we try to force it.
			TextBox box = new TextBox {
				HorizontalScrollBarVisibility = ScrollBarVisibility.Visible,
				VerticalScrollBarVisibility = ScrollBarVisibility.Visible,
				Text = new string ('*', 1000),
				TextWrapping = TextWrapping.Wrap
			};

			CreateAsyncTest (box, () => {
				var scroller = box.FindFirstChild<ScrollViewer> ();
				Assert.AreEqual (ScrollBarVisibility.Disabled, scroller.HorizontalScrollBarVisibility, "#1");
				Assert.AreEqual (ScrollBarVisibility.Visible, scroller.VerticalScrollBarVisibility, "#2");
			});
		}
Exemple #2
0
		public void TextBoxScrollable_NoWrap ()
		{
			// If we disable wrapping, our ScrollViewer is scrollable.
			TextBox box = new TextBox {
				HorizontalScrollBarVisibility = ScrollBarVisibility.Visible,
				VerticalScrollBarVisibility  = ScrollBarVisibility.Visible,
				Text = new string('*', 1000),
				TextWrapping = TextWrapping.NoWrap
			};

			CreateAsyncTest (box, () => {
				var scroller = box.FindFirstChild<ScrollViewer> ();
				Assert.AreEqual (ScrollBarVisibility.Visible, scroller.HorizontalScrollBarVisibility, "#1");
				Assert.AreEqual (ScrollBarVisibility.Visible, scroller.VerticalScrollBarVisibility, "#2");
			});
		}