diff options
author | Paul DiPietro <paul.dipietro@me.com> | 2016-04-11 09:50:28 -0700 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-04-11 09:50:28 -0700 |
commit | b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c (patch) | |
tree | 227d1614c84e3d2dbe7f6231276955a6a174ff6d /Xamarin.Forms.Platform.WP8/Platform.cs | |
parent | c0468f1cc33fc4dc415c3a3ca4dc71986b04fc9c (diff) | |
download | xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.gz xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.tar.bz2 xamarin-forms-b2ad3e53a8ae03536cf9071b0bd5d0207ee2f10c.zip |
Enable CS0618 warnings as errors (#72)
CS0618 occurs when using an obsolete property or method.
https://msdn.microsoft.com/en-us/library/x5ye6x1e.aspx
Diffstat (limited to 'Xamarin.Forms.Platform.WP8/Platform.cs')
-rw-r--r-- | Xamarin.Forms.Platform.WP8/Platform.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WP8/Platform.cs b/Xamarin.Forms.Platform.WP8/Platform.cs index 4626542f..84a3e769 100644 --- a/Xamarin.Forms.Platform.WP8/Platform.cs +++ b/Xamarin.Forms.Platform.WP8/Platform.cs @@ -475,7 +475,9 @@ namespace Xamarin.Forms.Platform.WinPhone foreach (Page f in _navModel.Roots) { f.Layout(new Rectangle(0, 0, _renderer.ActualWidth, _renderer.ActualHeight)); +#pragma warning disable 618 IVisualElementRenderer pageRenderer = f.GetRenderer(); +#pragma warning restore 618 if (pageRenderer != null) { ((FrameworkElement)pageRenderer.ContainerElement).Width = _renderer.ActualWidth; @@ -540,7 +542,9 @@ namespace Xamarin.Forms.Platform.WinPhone var button = new TaggedAppBarButton { IconUri = new Uri(item.Icon ?? "ApplicationIcon.jpg", UriKind.Relative), +#pragma warning disable 618 Text = !string.IsNullOrWhiteSpace(item.Name) ? item.Text : (string)item.Icon ?? "ApplicationIcon.jpg", +#pragma warning restore 618 IsEnabled = item.IsEnabled, Tag = item }; @@ -554,7 +558,9 @@ namespace Xamarin.Forms.Platform.WinPhone if (_page.ApplicationBar.MenuItems.OfType<TaggedAppBarMenuItem>().Any(b => b.Tag == item)) continue; +#pragma warning disable 618 var button = new TaggedAppBarMenuItem { Text = !string.IsNullOrWhiteSpace(item.Name) ? item.Text : (string)item.Icon ?? "MenuItem", IsEnabled = true, Tag = item }; +#pragma warning restore 618 button.Click += (sender, args) => item.Activate(); menuItemsToAdd.Add(button); } @@ -624,7 +630,9 @@ namespace Xamarin.Forms.Platform.WinPhone if (e.PropertyName == MenuItem.IsEnabledProperty.PropertyName) IsEnabled = item.IsEnabled; else if (e.PropertyName == MenuItem.TextProperty.PropertyName) +#pragma warning disable 618 Text = !string.IsNullOrWhiteSpace(item.Name) ? item.Text : (string)item.Icon ?? "ApplicationIcon.jpg"; +#pragma warning restore 618 else if (e.PropertyName == MenuItem.IconProperty.PropertyName) IconUri = new Uri(item.Icon ?? "ApplicationIcon.jpg", UriKind.Relative); } |