コード例 #1
0
ファイル: PlusArea.cs プロジェクト: Octavio/moro.fkalc
		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);
		}
コード例 #2
0
ファイル: ResultArea.cs プロジェクト: Octavio/moro.fkalc
		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);
		}
コード例 #3
0
		public MultiplicationArea ()
		{
			HeightRequest = 4;
			WidthRequest = 4;
			
			var canvas = new Canvas ();
			
			var ellipse = new Ellipse ()
			{
				WidthRequest = 4,
				HeightRequest = 4,
				StrokeThickness = 1,
				Fill = Brushes.Black
			};
						
			canvas.Children.Add (ellipse);			
			
			Content = canvas;
			Margin = new Thickness (2, 0, 2, 0);
		}