summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/CoreGalleryPages/CoreBoxViewGalleryPage.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls/CoreGalleryPages/CoreBoxViewGalleryPage.cs')
-rw-r--r--Xamarin.Forms.Controls/CoreGalleryPages/CoreBoxViewGalleryPage.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/CoreGalleryPages/CoreBoxViewGalleryPage.cs b/Xamarin.Forms.Controls/CoreGalleryPages/CoreBoxViewGalleryPage.cs
new file mode 100644
index 00000000..57ceaf44
--- /dev/null
+++ b/Xamarin.Forms.Controls/CoreGalleryPages/CoreBoxViewGalleryPage.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Threading;
+
+using Xamarin.Forms.CustomAttributes;
+
+namespace Xamarin.Forms.Controls
+{
+ internal class CoreBoxViewGalleryPage : CoreGalleryPage<BoxView>
+ {
+ static readonly object SyncLock = new object ();
+ static readonly Random Rand = new Random ();
+
+ protected override bool SupportsFocus
+ {
+ get { return false; }
+ }
+
+ protected override void InitializeElement (BoxView element)
+ {
+ lock (SyncLock) {
+ var red = Rand.NextDouble ();
+ var green = Rand.NextDouble ();
+ var blue = Rand.NextDouble ();
+ element.Color = new Color (red, green, blue);
+ }
+ }
+
+ protected override void Build (StackLayout stackLayout)
+ {
+ base.Build (stackLayout);
+
+ var colorContainer = new ViewContainer<BoxView> (Test.BoxView.Color, new BoxView { Color = Color.Pink });
+
+ Add (colorContainer);
+ }
+ }
+} \ No newline at end of file