summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/GalleryPages/ClipToBoundsGallery.cs
diff options
context:
space:
mode:
authorJason Smith <jason.smith@xamarin.com>2016-03-22 13:02:25 -0700
committerJason Smith <jason.smith@xamarin.com>2016-03-22 16:13:41 -0700
commit17fdde66d94155fc62a034fa6658995bef6fd6e5 (patch)
treeb5e5073a2a7b15cdbe826faa5c763e270a505729 /Xamarin.Forms.Controls/GalleryPages/ClipToBoundsGallery.cs
downloadxamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.gz
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.tar.bz2
xamarin-forms-17fdde66d94155fc62a034fa6658995bef6fd6e5.zip
Initial import
Diffstat (limited to 'Xamarin.Forms.Controls/GalleryPages/ClipToBoundsGallery.cs')
-rw-r--r--Xamarin.Forms.Controls/GalleryPages/ClipToBoundsGallery.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/ClipToBoundsGallery.cs b/Xamarin.Forms.Controls/GalleryPages/ClipToBoundsGallery.cs
new file mode 100644
index 00000000..b7cdd8fb
--- /dev/null
+++ b/Xamarin.Forms.Controls/GalleryPages/ClipToBoundsGallery.cs
@@ -0,0 +1,31 @@
+´╗┐using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Xamarin.Forms.Controls
+{
+ public class ClipToBoundsGallery : ContentPage
+ {
+ public ClipToBoundsGallery ()
+ {
+ var child1 = new BoxView { Color = Color.Red };
+ var child2 = new BoxView { Color = Color.Blue };
+ var button = new Button { Text = "Clip", BackgroundColor = Color.Green };
+
+ Padding = new Thickness (55);
+ var layout = new AbsoluteLayout {
+ Children = {
+ {child1, new Rectangle (-50, 0, 100, 100)},
+ {child2, new Rectangle (0, -50, 100, 100)},
+ {button, new Rectangle (1.0, 0.5, 100, 100), AbsoluteLayoutFlags.PositionProportional}
+ }
+ };
+
+ button.Clicked += (sender, args) => layout.IsClippedToBounds = !layout.IsClippedToBounds;
+
+ Content = layout;
+ }
+ }
+}