diff options
Diffstat (limited to 'Xamarin.Forms.Platform.WP8')
-rw-r--r-- | Xamarin.Forms.Platform.WP8/LabelRenderer.cs | 5 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.WP8/Platform.cs | 8 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs | 2 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj | 18 |
4 files changed, 23 insertions, 10 deletions
diff --git a/Xamarin.Forms.Platform.WP8/LabelRenderer.cs b/Xamarin.Forms.Platform.WP8/LabelRenderer.cs index 86c68adf..fbb3f9c2 100644 --- a/Xamarin.Forms.Platform.WP8/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.WP8/LabelRenderer.cs @@ -24,8 +24,9 @@ namespace Xamarin.Forms.Platform.WinPhone run.Foreground = span.ForegroundColor.ToBrush(); if (!span.IsDefault()) +#pragma warning disable 618 run.ApplyFont(span.Font); - +#pragma warning restore 618 return run; } } @@ -121,7 +122,9 @@ namespace Xamarin.Forms.Platform.WinPhone if (label == null || (label.IsDefault() && !_fontApplied)) return; +#pragma warning disable 618 Font fontToApply = label.IsDefault() ? Font.SystemFontOfSize(NamedSize.Medium) : label.Font; +#pragma warning restore 618 textBlock.ApplyFont(fontToApply); _fontApplied = true; 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); } diff --git a/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs b/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs index 9ec274c5..27e37997 100644 --- a/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs +++ b/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs @@ -144,7 +144,9 @@ namespace Xamarin.Forms.Platform.WinPhone var child = Element.LogicalChildren[i] as VisualElement; if (child == null) continue; +#pragma warning disable 618 IVisualElementRenderer renderer = child.GetRenderer(); +#pragma warning restore 618 if (renderer == null) continue; Rectangle bounds = child.Bounds; diff --git a/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj b/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj index c615ba4b..6036a1af 100644 --- a/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj +++ b/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj @@ -32,7 +32,7 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <NoWarn>0618;0219</NoWarn> + <NoWarn>0219</NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -44,7 +44,7 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <NoWarn>0114;4014;0618;0219;0067</NoWarn> + <NoWarn>0114;4014;0219;0067</NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <DebugSymbols>true</DebugSymbols> @@ -56,7 +56,7 @@ <NoConfig>true</NoConfig> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <NoWarn>0114;4014;0618;0219;0067</NoWarn> + <NoWarn>0114;4014;0219;0067</NoWarn> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "> @@ -68,7 +68,7 @@ <NoConfig>true</NoConfig> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <NoWarn>0114;4014;0618;0219;0067</NoWarn> + <NoWarn>0114;4014;0219;0067</NoWarn> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|ARM' "> @@ -81,7 +81,7 @@ <NoConfig>true</NoConfig> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <NoWarn>0114;4014;0618;0219;0067</NoWarn> + <NoWarn>0114;4014;0219;0067</NoWarn> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|ARM' "> @@ -93,7 +93,7 @@ <NoConfig>true</NoConfig> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <NoWarn>0114;4014;0618;0219;0067</NoWarn> + <NoWarn>0114;4014;0219;0067</NoWarn> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|AnyCPU'"> @@ -106,7 +106,7 @@ <ErrorReport>prompt</ErrorReport> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> - <NoWarn>0114;4014;0618;0219;0067</NoWarn> + <NoWarn>0114;4014;0219;0067</NoWarn> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|x86'"> <DebugSymbols>true</DebugSymbols> @@ -117,7 +117,7 @@ <PlatformTarget>AnyCPU</PlatformTarget> <ErrorReport>prompt</ErrorReport> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> - <NoWarn>0114;4014;0618;0219;0067</NoWarn> + <NoWarn>0114;4014;0219;0067</NoWarn> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Turkey|ARM'"> @@ -129,7 +129,7 @@ <PlatformTarget>AnyCPU</PlatformTarget> <ErrorReport>prompt</ErrorReport> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> - <NoWarn>0114;4014;0618;0219;0067</NoWarn> + <NoWarn>0114;4014;0219;0067</NoWarn> <TreatWarningsAsErrors>true</TreatWarningsAsErrors> </PropertyGroup> <ItemGroup> |