Skip to content
This repository was archived by the owner on Apr 29, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protected override void OnCreate(Bundle bundle)

base.OnCreate(bundle);

Xamarin.Forms.Forms.SetFlags(new string[] {"SwipeView_Experimental", "CarouselView_Experimental", "MediaElement_Experimental", "RadioButton_Experimental", "Expander_Experimental" });
Xamarin.Forms.Forms.SetFlags(new string[] {"SwipeView_Experimental", "CarouselView_Experimental", "MediaElement_Experimental", "RadioButton_Experimental", "Expander_Experimental", "Shapes_Experimental" });
global::Xamarin.Forms.Forms.Init(this, bundle);
global::Xamarin.FormsMaps.Init(this, bundle);
LoadApplication(new App());
Expand Down
2 changes: 1 addition & 1 deletion FormsGallery/FormsGallery/FormsGallery.UWP/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)

rootFrame.NavigationFailed += OnNavigationFailed;

Xamarin.Forms.Forms.SetFlags(new string[] { "SwipeView_Experimental", "CarouselView_Experimental", "MediaElement_Experimental", "RadioButton_Experimental", "Expander_Experimental" });
Xamarin.Forms.Forms.SetFlags(new string[] { "SwipeView_Experimental", "CarouselView_Experimental", "MediaElement_Experimental", "RadioButton_Experimental", "Expander_Experimental", "Shapes_Experimental" });
Xamarin.Forms.Forms.Init(e);

Xamarin.FormsMaps.Init("MAP_KEY");
Expand Down
2 changes: 1 addition & 1 deletion FormsGallery/FormsGallery/FormsGallery.iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsAppli
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
Xamarin.Forms.Forms.SetFlags(new string[] { "SwipeView_Experimental", "CarouselView_Experimental", "MediaElement_Experimental", "RadioButton_Experimental", "Expander_Experimental" });
Xamarin.Forms.Forms.SetFlags(new string[] { "SwipeView_Experimental", "CarouselView_Experimental", "MediaElement_Experimental", "RadioButton_Experimental", "Expander_Experimental", "Shapes_Experimental" });
global::Xamarin.Forms.Forms.Init();
global::Xamarin.FormsMaps.Init();
LoadApplication(new App());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using Xamarin.Forms;
using Xamarin.Forms.Shapes;

namespace FormsGallery.CodeExamples
{
public class EllipseDemoPage : ContentPage
{
public EllipseDemoPage()
{
Label header = new Label
{
Text = "Ellipse",
FontSize = 50,
FontAttributes = FontAttributes.Bold,
HorizontalOptions = LayoutOptions.Center
};

Ellipse ellipse = new Ellipse
{
Fill = Color.Red,
WidthRequest = 150,
HeightRequest = 50,
HorizontalOptions = LayoutOptions.Center
};

Ellipse circle = new Ellipse
{
Stroke = Color.Red,
StrokeThickness = 4,
WidthRequest = 150,
HeightRequest = 150,
HorizontalOptions = LayoutOptions.Center
};

// Build the page.
Title = "Ellipse Demo";
Content = new StackLayout
{
Children =
{
header,
ellipse,
circle
}
};
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Xamarin.Forms;
using Xamarin.Forms.Shapes;

namespace FormsGallery.CodeExamples
{
public class LineDemoPage : ContentPage
{
public LineDemoPage()
{
Label header = new Label
{
Text = "Line",
FontSize = 50,
FontAttributes = FontAttributes.Bold,
HorizontalOptions = LayoutOptions.Center
};

Line line = new Line
{
X1 = 40,
Y1 = 0,
X2 = 0,
Y2 = 120,
Stroke = Color.Red,
HorizontalOptions = LayoutOptions.Center
};

// Build the page.
Title = "Line Demo";
Content = new StackLayout
{
Children =
{
header,
line
}
};
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
using Xamarin.Forms;
using Xamarin.Forms.Shapes;

namespace FormsGallery.CodeExamples
{
public class PathDemoPage : ContentPage
{
public PathDemoPage()
{
Label header = new Label
{
Text = "Path",
FontSize = 50,
FontAttributes = FontAttributes.Bold,
HorizontalOptions = LayoutOptions.Center
};

Path path = new Path
{
Stroke = Color.Black,
Aspect = Stretch.Uniform,
HorizontalOptions = LayoutOptions.Center,
HeightRequest = 100,
WidthRequest = 100,
Data = new PathGeometry
{
Figures = new PathFigureCollection
{
new PathFigure
{
IsClosed = true,
StartPoint = new Point { X = 13.908992, Y = 16.207977 },
Segments = new PathSegmentCollection
{
new LineSegment { Point = new Point { X = 32.000048, Y = 16.207977 } },
new LineSegment { Point = new Point { X = 32.000049, Y = 31.999985 } },
new LineSegment { Point = new Point { X = 13.908992, Y = 30.109983 } }
}
},
new PathFigure
{
IsClosed = true,
StartPoint = new Point { X = 0, Y = 16.207977 },
Segments = new PathSegmentCollection
{
new LineSegment { Point = new Point { X = 11.904009, Y = 16.207977 } },
new LineSegment { Point = new Point { X = 11.904009, Y = 29.900984 } },
new LineSegment { Point = new Point { X = 0, Y = 28.657984 } }
}
},
new PathFigure
{
IsClosed = true,
StartPoint = new Point { X = 11.904036, Y = 2.0979624 },
Segments = new PathSegmentCollection
{
new LineSegment { Point = new Point { X = 11.904036, Y = 14.202982 } },
new LineSegment { Point = new Point { X = 2.7656555E-05, Y = 14.202982 } },
new LineSegment { Point = new Point { X = 2.7656555E-05, Y = 3.3409645 } }
}
},
new PathFigure
{
IsClosed = true,
StartPoint = new Point { X = 32.000058, Y = 0},
Segments = new PathSegmentCollection
{
new LineSegment { Point = new Point { X = 32.000058, Y = 14.203001 } },
new LineSegment { Point = new Point { X = 13.909059, Y = 14.203001 } },
new LineSegment { Point = new Point { X = 13.909059, Y = 1.8890382 } }
}
}
}
}
};

// Build the page.
Title = "Path Demo";
Content = new StackLayout
{
Children =
{
header,
path
}
};
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using Xamarin.Forms;
using Xamarin.Forms.Shapes;

namespace FormsGallery.CodeExamples
{
public class PolygonDemoPage : ContentPage
{
public PolygonDemoPage()
{
Label header = new Label
{
Text = "Polygon",
FontSize = 50,
FontAttributes = FontAttributes.Bold,
HorizontalOptions = LayoutOptions.Center
};

Polygon polygon = new Polygon
{
Points = new PointCollection
{
new Point { X = 0, Y = 48 },
new Point { X = 0, Y = 144 },
new Point { X = 96, Y = 150 },
new Point { X = 100, Y = 0 },
new Point { X = 192, Y = 0 },
new Point { X = 192, Y = 96 },
new Point { X = 50, Y = 96 },
new Point { X = 48, Y = 192 },
new Point { X = 150, Y = 200 },
new Point { X = 144, Y = 48 }
},
Fill = Color.Blue,
Stroke = Color.Red,
StrokeThickness = 3,
HorizontalOptions = LayoutOptions.Center
};

// Build the page.
Title = "Polygon Demo";
Content = new StackLayout
{
Children =
{
header,
polygon
}
};
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using Xamarin.Forms;
using Xamarin.Forms.Shapes;

namespace FormsGallery.CodeExamples
{
public class PolylineDemoPage : ContentPage
{
public PolylineDemoPage()
{
Label header = new Label
{
Text = "Polyline",
FontSize = 50,
FontAttributes = FontAttributes.Bold,
HorizontalOptions = LayoutOptions.Center
};

Polyline polyline = new Polyline
{
Points = new PointCollection
{
new Point { X = 0, Y = 0 },
new Point { X = 10, Y = 30 },
new Point { X = 15, Y = 0 },
new Point { X = 18, Y = 60 },
new Point { X = 23, Y = 30 },
new Point { X = 35, Y = 30 },
new Point { X = 40, Y = 0 },
new Point { X = 43, Y = 60 },
new Point { X = 48, Y = 30 },
new Point { X = 100, Y = 30 }
},
Stroke = Color.Red,
HorizontalOptions = LayoutOptions.Center
};

// Build the page.
Title = "Polyline Demo";
Content = new StackLayout
{
Children =
{
header,
polyline
}
};
}
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
using Xamarin.Forms;
using Rect = Xamarin.Forms.Shapes.Rectangle;

namespace FormsGallery.CodeExamples
{
public class RectangleDemoPage : ContentPage
{
public RectangleDemoPage()
{
Label header = new Label
{
Text = "Rectangle",
FontSize = 50,
FontAttributes = FontAttributes.Bold,
HorizontalOptions = LayoutOptions.Center
};

Rect rectangle = new Rect
{
Fill = Color.Red,
WidthRequest = 150,
HeightRequest = 50,
HorizontalOptions = LayoutOptions.Center
};

Rect square = new Rect
{
Stroke = Color.Red,
StrokeThickness = 4,
WidthRequest = 150,
HeightRequest = 150,
HorizontalOptions = LayoutOptions.Center
};

// Build the page.
Title = "Rectangle Demo";
Content = new StackLayout
{
Children =
{
header,
rectangle,
square
}
};
}
}
}

Loading