コード例 #1
0
ファイル: FractionArea.cs プロジェクト: olegsur/moro.fkalc
		public FractionArea ()
		{
			Content = panel;		
			
			Dividend = new ContentControl () 
			{
				Content = new TextArea(),
				Margin = new Thickness (5, 0, 5, 3),
				HorizontalAlignment = HorizontalAlignment.Center
			};

			Divisor = new ContentControl () 
			{
				Content = new TextArea(),
				Margin = new Thickness (5, 2, 5, 0),
				HorizontalAlignment = HorizontalAlignment.Center
			};
			
			var line = new Line ()
			{
				HeightRequest = 2,
				StrokeThickness = 2,
				HorizontalAlignment = HorizontalAlignment.Stretch,
			};
			
			panel.Children.Add (Dividend);
			panel.Children.Add (line);			
			panel.Children.Add (Divisor);

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

			Margin = new Thickness (2, 0, 2, 0);
		}
コード例 #2
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);
		}
コード例 #3
0
		public Border ()
		{
			padding = BuildVisualProperty<Thickness> ("Padding");
			background = BuildVisualProperty<Brush> ("Background");
			borderColor = BuildVisualProperty<Color> ("BorderColor");
			borderThickness = BuildVisualProperty<double> ("BorderThickness");
			cornerRadius = BuildVisualProperty<CornerRadius> ("CornerRadius");
					
			BorderColor = Colors.Black;
			BorderThickness = 1;
			Padding = new Thickness (5);
		}
コード例 #4
0
		public FrameworkElement ()
		{	
			dataContext = BuildProperty<object> ("DataContext");
			margin = BuildProperty<Thickness> ("Margin");
			horizontalAlignment = BuildProperty<HorizontalAlignment> ("HorizontalAlignment");
			verticalAlignment = BuildProperty<VerticalAlignment> ("VerticalAlignment");
			style = BuildProperty<Style> ("Style");			

			Margin = new Thickness (0);
			HorizontalAlignment = HorizontalAlignment.Left;
			VerticalAlignment = VerticalAlignment.Top;
			
			style.DependencyPropertyValueChanged += HandleStyleChanged;
		}			
コード例 #5
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);
		}
コード例 #6
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);
		}
コード例 #7
0
ファイル: CommaArea.cs プロジェクト: Octavio/moro.fkalc
		public CommaArea ()
		{
			var figure = new PathFigure ();
			figure.StartPoint = new Point (4, 2);

			figure.Segments.Add (new ArcSegment () 
			{ 
				Point = new Point (2, 2), Size = new Size (1, 1), RotationAngle = Math.PI, IsLargeArc = true, SweepDirection = SweepDirection.Clockwise
			}
			);

			figure.Segments.Add (new ArcSegment () 
			{ 
				Point = new Point (4, 2), Size = new Size (1, 1), RotationAngle = Math.PI, IsLargeArc = true, SweepDirection = SweepDirection.Clockwise
			}
			);

			figure.Segments.Add (new ArcSegment () 
			{ 
				Point = new Point (2, 6), Size = new Size (12, 12), RotationAngle = Math.PI, IsLargeArc = false, SweepDirection = SweepDirection.Clockwise
			}
			);
				
			var geometry = new PathGeometry ();
			geometry.Figures.Add (figure);
			var path = new Path ();
			path.Data = geometry;

			Content = path;

			HeightRequest = 3;
			WidthRequest = 3;

			VerticalAlignment = VerticalAlignment.Bottom;
			Margin = new Thickness (2, 0, 2, 0);
		}
コード例 #8
0
ファイル: ParenthesesArea.cs プロジェクト: Octavio/moro.fkalc
			public Parentheses ()
			{
				WidthRequest = 6;
				VerticalAlignment = VerticalAlignment.Stretch;
				Margin = new Thickness (2, 4, 0, 4);
			}