summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/GalleryPages/LineBreakModeGallery.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Controls/GalleryPages/LineBreakModeGallery.cs')
-rw-r--r--Xamarin.Forms.Controls/GalleryPages/LineBreakModeGallery.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/LineBreakModeGallery.cs b/Xamarin.Forms.Controls/GalleryPages/LineBreakModeGallery.cs
new file mode 100644
index 00000000..8089bc79
--- /dev/null
+++ b/Xamarin.Forms.Controls/GalleryPages/LineBreakModeGallery.cs
@@ -0,0 +1,41 @@
+´╗┐using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Xamarin.Forms.Controls
+{
+ public class LineBreakModeGallery : ContentPage
+ {
+ public LineBreakModeGallery ()
+ {
+ var label = new Label {
+ Text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
+ };
+
+ Content = new ScrollView {
+ Content = new StackLayout {
+ Spacing = 0,
+ Children = {
+ MakeLineBreakModeButton ("CharacterWrap", label, LineBreakMode.CharacterWrap),
+ MakeLineBreakModeButton ("HeadTruncation", label, LineBreakMode.HeadTruncation),
+ MakeLineBreakModeButton ("MiddleTruncation", label, LineBreakMode.MiddleTruncation),
+ MakeLineBreakModeButton ("NoWrap", label, LineBreakMode.NoWrap),
+ MakeLineBreakModeButton ("TailTruncation", label, LineBreakMode.TailTruncation),
+ MakeLineBreakModeButton ("WordWrap", label, LineBreakMode.WordWrap),
+ label
+ }
+ }
+ };
+ }
+
+ static Button MakeLineBreakModeButton (string buttonText, Label label, LineBreakMode lineBreakMode) {
+ var button = new Button {
+ Text = buttonText,
+ Command = new Command (() => label.LineBreakMode = lineBreakMode)
+ };
+ return button;
+ }
+ }
+}