Esempio n. 1
0
		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);
		}
		private static Button CloseButton ()
		{
			var figure1 = new PathFigure ();
			figure1.StartPoint = new Point (0, 0);
			figure1.Segments.Add (new LineSegment () { Point = new Point(7,7)});
			
			var figure2 = new PathFigure ();
			figure2.StartPoint = new Point (7, 0);
			figure2.Segments.Add (new LineSegment () { Point = new Point(0,7)});
			
			var pathGeomentry = new PathGeometry ();
			pathGeomentry.Figures.Add (figure1);
			pathGeomentry.Figures.Add (figure2);
			
			var path = new Path ();
			path.WidthRequest = 7;
			path.HeightRequest = 7;
			path.Stroke = Colors.White;
			path.StrokeThickness = 2;
			path.Data = pathGeomentry;
			
			var button = new Button () { Content = path };
			button.Padding = new Thickness (4);
			button.BorderColor = new Color (0x1f, 0x42, 0x6f); 
			button.BorderThickness = 1;
			button.Background = GetTitleBrush ();
			return button;
		}