summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/CoreGalleryPages/EditorCoreGalleryPage.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls/CoreGalleryPages/EditorCoreGalleryPage.cs')
-rw-r--r--Xamarin.Forms.Controls/CoreGalleryPages/EditorCoreGalleryPage.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/CoreGalleryPages/EditorCoreGalleryPage.cs b/Xamarin.Forms.Controls/CoreGalleryPages/EditorCoreGalleryPage.cs
new file mode 100644
index 00000000..d7c749be
--- /dev/null
+++ b/Xamarin.Forms.Controls/CoreGalleryPages/EditorCoreGalleryPage.cs
@@ -0,0 +1,51 @@
+using Xamarin.Forms.CustomAttributes;
+
+namespace Xamarin.Forms.Controls
+{
+ internal class EditorCoreGalleryPage : CoreGalleryPage<Editor>
+ {
+ protected override bool SupportsTapGestureRecognizer
+ {
+ get { return false; }
+ }
+
+ protected override void Build (StackLayout stackLayout)
+ {
+ base.Build (stackLayout);
+
+ var completedContainer = new EventViewContainer<Editor> (Test.Editor.Completed, new Editor ());
+ completedContainer.View.Completed += (sender, args) => completedContainer.EventFired ();
+
+ var textContainer = new ViewContainer<Editor> (Test.Editor.Text, new Editor { Text = "I have text" });
+
+ var textChangedContainer = new EventViewContainer<Editor> (Test.Editor.TextChanged, new Editor ());
+ textChangedContainer.View.TextChanged += (sender, args) => textChangedContainer.EventFired ();
+
+ var textFontAttributesContainer = new ViewContainer<Editor> (Test.Editor.FontAttributes, new Editor { Text = "I have italic text", FontAttributes = FontAttributes.Italic });
+ var textFamilyContainer1 = new ViewContainer<Editor> (Test.Editor.FontFamily, new Editor { Text = "I have Comic Sans text in Win & Android", FontFamily = "Comic Sans MS" });
+ var textFamilyContainer2 = new ViewContainer<Editor> (Test.Editor.FontFamily, new Editor { Text = "I have bold Chalkboard text in iOS", FontFamily = "ChalkboardSE-Regular", FontAttributes = FontAttributes.Bold });
+ var textFontSizeContainer = new ViewContainer<Editor> (Test.Editor.FontSize, new Editor { Text = "I have default size text" });
+ var textFontSizeDefaultContainer = new ViewContainer<Editor> (Test.Editor.FontSize, new Editor { Text = "I also have default size text" });
+ textFontSizeDefaultContainer.View.FontSize = Device.GetNamedSize (NamedSize.Default, textFontSizeDefaultContainer.View);
+ var textFontSizeLargeContainer = new ViewContainer<Editor> (Test.Editor.FontSize, new Editor { Text = "I have size 48 (huge) text", FontSize = 48 });
+
+ var textColorContainer = new ViewContainer<Editor> (Test.Editor.TextColor,
+ new Editor { Text = "I should have red text", TextColor = Color.Red });
+
+ var textColorDisabledContainer = new ViewContainer<Editor> (Test.Editor.TextColor,
+ new Editor { Text = "I should have the default disabled text color", TextColor = Color.Red, IsEnabled = false });
+
+ Add (completedContainer);
+ Add (textContainer);
+ Add (textChangedContainer);
+ Add (textFontAttributesContainer);
+ Add (textFamilyContainer1);
+ Add (textFamilyContainer2);
+ Add (textFontSizeContainer);
+ Add (textFontSizeDefaultContainer);
+ Add (textFontSizeLargeContainer);
+ Add (textColorContainer);
+ Add (textColorDisabledContainer);
+ }
+ }
+} \ No newline at end of file