diff options
Diffstat (limited to 'Xamarin.Forms.Controls/GalleryPages')
4 files changed, 50 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/GalleryPages/GroupedListContactsGallery.cs b/Xamarin.Forms.Controls/GalleryPages/GroupedListContactsGallery.cs index 1058b692..68115f9f 100644 --- a/Xamarin.Forms.Controls/GalleryPages/GroupedListContactsGallery.cs +++ b/Xamarin.Forms.Controls/GalleryPages/GroupedListContactsGallery.cs @@ -41,7 +41,9 @@ namespace Xamarin.Forms.Controls Label name = new Label(); name.SetBinding (Label.TextProperty, "FullName"); +#pragma warning disable 618 Label title = new Label { Font = Font.SystemFontOfSize (NamedSize.Micro) }; +#pragma warning restore 618 title.SetBinding (Label.TextProperty, "Title"); return new ViewCell { View = new StackLayout { diff --git a/Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs b/Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs index 65210969..c40d7ae4 100644 --- a/Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs +++ b/Xamarin.Forms.Controls/GalleryPages/LabelGallery.cs @@ -36,32 +36,68 @@ namespace Xamarin.Forms.Controls }; var formatted = new Label { FormattedText = new FormattedString { Spans = { +#pragma warning disable 618 new Span {Text="FormattedStrings ", ForegroundColor=Color.Blue, BackgroundColor = Color.Yellow, Font = Font.BoldSystemFontOfSize (NamedSize.Large)}, +#pragma warning restore 618 new Span {Text="are ", ForegroundColor=Color.Red, BackgroundColor = Color.Gray}, new Span {Text="not pretty!", ForegroundColor = Color.Green,}, } } }; var missingfont = new Label { Text = "Missing font: use default" }; +#pragma warning disable 618 micro.Font = Font.SystemFontOfSize (NamedSize.Micro); +#pragma warning restore 618 + +#pragma warning disable 618 small.Font = Font.SystemFontOfSize (NamedSize.Small); +#pragma warning restore 618 + +#pragma warning disable 618 medium.Font = Font.SystemFontOfSize (NamedSize.Medium); +#pragma warning restore 618 + +#pragma warning disable 618 large.Font = Font.SystemFontOfSize (NamedSize.Large); +#pragma warning restore 618 +#pragma warning disable 618 bold.Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold); +#pragma warning restore 618 + +#pragma warning disable 618 italic.Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Italic); +#pragma warning restore 618 + +#pragma warning disable 618 bolditalic.Font = Font.SystemFontOfSize (NamedSize.Medium, FontAttributes.Bold | FontAttributes.Italic); +#pragma warning restore 618 var fontName = Device.OnPlatform ("Georgia", "sans-serif-light", "Comic Sans MS"); var font = Font.OfSize (fontName, NamedSize.Medium); +#pragma warning disable 618 customFont.Font = font; +#pragma warning restore 618 + +#pragma warning disable 618 italicfont.Font = font.WithAttributes (FontAttributes.Italic); +#pragma warning restore 618 + +#pragma warning disable 618 boldfont.Font = font.WithAttributes (FontAttributes.Bold); +#pragma warning restore 618 + +#pragma warning disable 618 bolditalicfont.Font = font.WithAttributes (FontAttributes.Bold | FontAttributes.Italic); +#pragma warning restore 618 +#pragma warning disable 618 customFont.GestureRecognizers.Add (new TapGestureRecognizer{Command = new Command (o => customFont.Font = Font.Default)}); +#pragma warning restore 618 +#pragma warning disable 618 missingfont.Font = Font.OfSize ("FooBar", 20); +#pragma warning restore 618 center.HorizontalTextAlignment = TextAlignment.Center; right.HorizontalTextAlignment = TextAlignment.End; int i = 1; diff --git a/Xamarin.Forms.Controls/GalleryPages/ListViewDemoPage.cs b/Xamarin.Forms.Controls/GalleryPages/ListViewDemoPage.cs index a30ec170..370fb6d9 100644 --- a/Xamarin.Forms.Controls/GalleryPages/ListViewDemoPage.cs +++ b/Xamarin.Forms.Controls/GalleryPages/ListViewDemoPage.cs @@ -125,7 +125,9 @@ namespace Xamarin.Forms.Controls Label header = new Label { Text = "ListView", +#pragma warning disable 618 Font = Font.BoldSystemFontOfSize(50), +#pragma warning restore 618 HorizontalOptions = LayoutOptions.Center }; @@ -135,7 +137,9 @@ namespace Xamarin.Forms.Controls new Person("Abigail", new DateTime(1975, 1, 15), Color.Aqua), new Person("Bob", new DateTime(1976, 2, 20), Color.Black), new Person("Cathy", new DateTime(1977, 3, 10), Color.Blue), +#pragma warning disable 618 new Person("David", new DateTime(1978, 4, 25), Color.Fuschia), +#pragma warning restore 618 new Person("Eugenie", new DateTime(1979, 5, 5), Color.Gray), new Person("Freddie", new DateTime(1980, 6, 30), Color.Green), new Person("Greta", new DateTime(1981, 7, 15), Color.Lime), @@ -150,7 +154,9 @@ namespace Xamarin.Forms.Controls new Person("Pendleton", new DateTime(1978, 4, 10), Color.Yellow), new Person("Queenie", new DateTime(1979, 5, 15), Color.Aqua), new Person("Rob", new DateTime(1980, 6, 30), Color.Blue), +#pragma warning disable 618 new Person("Sally", new DateTime(1981, 7, 5), Color.Fuschia), +#pragma warning restore 618 new Person("Timothy", new DateTime(1982, 8, 30), Color.Green), new Person("Uma", new DateTime(1983, 9, 10), Color.Lime), new Person("Victor", new DateTime(1984, 10, 20), Color.Maroon), @@ -164,7 +170,9 @@ namespace Xamarin.Forms.Controls new Person("Abigail", new DateTime(1975, 1, 15), Color.Aqua), new Person("Bob", new DateTime(1976, 2, 20), Color.Black), new Person("Cathy", new DateTime(1977, 3, 10), Color.Blue), +#pragma warning disable 618 new Person("David", new DateTime(1978, 4, 25), Color.Fuschia), +#pragma warning restore 618 new Person("Eugenie", new DateTime(1979, 5, 5), Color.Gray), new Person("Freddie", new DateTime(1980, 6, 30), Color.Green), new Person("Greta", new DateTime(1981, 7, 15), Color.Lime), @@ -179,7 +187,9 @@ namespace Xamarin.Forms.Controls new Person("Pendleton", new DateTime(1978, 4, 10), Color.Yellow), new Person("Queenie", new DateTime(1979, 5, 15), Color.Aqua), new Person("Rob", new DateTime(1980, 6, 30), Color.Blue), +#pragma warning disable 618 new Person("Sally", new DateTime(1981, 7, 5), Color.Fuschia), +#pragma warning restore 618 new Person("Timothy", new DateTime(1982, 8, 30), Color.Green), new Person("Uma", new DateTime(1983, 9, 10), Color.Lime), new Person("Victor", new DateTime(1984, 10, 20), Color.Maroon), diff --git a/Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs b/Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs index dfbc342c..e571539a 100644 --- a/Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs +++ b/Xamarin.Forms.Controls/GalleryPages/NavigationBarGallery.cs @@ -45,7 +45,9 @@ namespace Xamarin.Forms.Controls new Button { Text = "Make sure Tint still works", Command = new Command (() => { +#pragma warning disable 618 rootNavPage.Tint = Color.Red; +#pragma warning restore 618 }) }, new Button { |