Exemplo n.º 1
0
		public ResultArea ()
		{
			var line1 = new Line ()
			{
				WidthRequest = 12,
				HeightRequest = 2,
				StrokeThickness = 2,
				Stroke = Colors.Black,
				SnapsToDevicePixels = true
			};

			var line2 = new Line ()
			{
				WidthRequest = 12,
				HeightRequest = 2,
				StrokeThickness = 2,
				Stroke = Colors.Black,
				SnapsToDevicePixels = true
			};

			var canvas = new Canvas ();
			canvas.HeightRequest = 12;
			canvas.WidthRequest = 12;

			canvas.Children.Add (line1);
			canvas.Children.Add (line2);

			canvas.SetTop (3, line1);
			canvas.SetTop (7, line2);

			Child = new ContentControl ()
			{
				Content = new TextArea (),
				Margin = new Thickness (2, 0, 0, 0)
			};

			var stackPanel = new StackPanel ()
			{
				Orientation = Orientation.Horizontal
			};

			stackPanel.Children.Add (canvas);
			stackPanel.Children.Add (Child);

			Content = stackPanel;

			BindingOperations.SetBinding (this, "DataContext.Child", Child.GetProperty ("Content"), new TokenAreaConverter ());

			Margin = new Thickness (2, 0, 0, 0);
		}
Exemplo n.º 2
0
		public PlusArea ()
		{
			HeightRequest = 12;
			WidthRequest = 12;
			
			var canvas = new Canvas ();
			
			var line1 = new Line ()
			{
				WidthRequest = 12,
				HeightRequest = 2,
				StrokeThickness = 2,
				Stroke = Colors.Black,
				SnapsToDevicePixels = true
			};
			
			var line2 = new Line ()
			{
				WidthRequest = 2,
				HeightRequest = 12,
				StrokeThickness = 2,
				Stroke = Colors.Black,
				SnapsToDevicePixels = true
			};
			
			canvas.Children.Add (line1);
			canvas.Children.Add (line2);
			
			canvas.SetTop (5, line1);
			canvas.SetLeft (5, line2);
			
			Content = canvas;
			Margin = new Thickness (2);
		}