summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WP8
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-04-12 01:22:14 (GMT)
committerJason Smith <jason.smith@xamarin.com>2016-04-12 01:22:14 (GMT)
commit0a20bdaa3c373ec303c9a94ae45ecaa144996ba5 (patch)
treec4f2f38a34170800a8ae60da0e08f4546562fe14 /Xamarin.Forms.Platform.WP8
parent90d8976cfdadc1582e366c0b6f6611d6fe83f5ff (diff)
downloadxamarin-forms-0a20bdaa3c373ec303c9a94ae45ecaa144996ba5.zip
xamarin-forms-0a20bdaa3c373ec303c9a94ae45ecaa144996ba5.tar.gz
xamarin-forms-0a20bdaa3c373ec303c9a94ae45ecaa144996ba5.tar.bz2
Fix warnings 0219 and 0618 in WP8 Platform (#63)
* Fix warnings 0219 and 0618 in WP8 Platform Remove suppression of warnings 0219 and 0618 in WP8 Platform * Remove pragma for 0618 and use Platform.GetRenderer * All warnings as errors in Release configuration
Diffstat (limited to 'Xamarin.Forms.Platform.WP8')
-rw-r--r--Xamarin.Forms.Platform.WP8/CellControl.cs1
-rw-r--r--Xamarin.Forms.Platform.WP8/LabelRenderer.cs1
-rw-r--r--Xamarin.Forms.Platform.WP8/ListViewRenderer.cs1
-rw-r--r--Xamarin.Forms.Platform.WP8/Platform.cs12
-rw-r--r--Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs4
-rw-r--r--Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj6
6 files changed, 9 insertions, 16 deletions
diff --git a/Xamarin.Forms.Platform.WP8/CellControl.cs b/Xamarin.Forms.Platform.WP8/CellControl.cs
index 743f4ba..0f3eb46 100644
--- a/Xamarin.Forms.Platform.WP8/CellControl.cs
+++ b/Xamarin.Forms.Platform.WP8/CellControl.cs
@@ -59,7 +59,6 @@ namespace Xamarin.Forms.Platform.WinPhone
oldCell.SendDisappearing();
}
- DependencyObject content = null;
if (newCell != null)
{
newCell.SendAppearing();
diff --git a/Xamarin.Forms.Platform.WP8/LabelRenderer.cs b/Xamarin.Forms.Platform.WP8/LabelRenderer.cs
index fbb3f9c..67c5056 100644
--- a/Xamarin.Forms.Platform.WP8/LabelRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/LabelRenderer.cs
@@ -27,6 +27,7 @@ namespace Xamarin.Forms.Platform.WinPhone
#pragma warning disable 618
run.ApplyFont(span.Font);
#pragma warning restore 618
+
return run;
}
}
diff --git a/Xamarin.Forms.Platform.WP8/ListViewRenderer.cs b/Xamarin.Forms.Platform.WP8/ListViewRenderer.cs
index 362c993..e505526 100644
--- a/Xamarin.Forms.Platform.WP8/ListViewRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/ListViewRenderer.cs
@@ -481,7 +481,6 @@ namespace Xamarin.Forms.Platform.WinPhone
return;
var cell = (Cell)e.AddedItems[0];
- Cell parentCell = null;
if (cell == null)
{
diff --git a/Xamarin.Forms.Platform.WP8/Platform.cs b/Xamarin.Forms.Platform.WP8/Platform.cs
index 84a3e76..cda86bc 100644
--- a/Xamarin.Forms.Platform.WP8/Platform.cs
+++ b/Xamarin.Forms.Platform.WP8/Platform.cs
@@ -542,9 +542,7 @@ 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
+ Text = !string.IsNullOrWhiteSpace(item.Text) ? item.Text : (string)item.Icon ?? "ApplicationIcon.jpg",
IsEnabled = item.IsEnabled,
Tag = item
};
@@ -558,9 +556,7 @@ 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
+ var button = new TaggedAppBarMenuItem { Text = !string.IsNullOrWhiteSpace(item.Text) ? item.Text : (string)item.Icon ?? "MenuItem", IsEnabled = true, Tag = item };
button.Click += (sender, args) => item.Activate();
menuItemsToAdd.Add(button);
}
@@ -630,9 +626,7 @@ 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
+ Text = !string.IsNullOrWhiteSpace(item.Text) ? item.Text : (string)item.Icon ?? "ApplicationIcon.jpg";
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 27e3799..aca47d6 100644
--- a/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs
+++ b/Xamarin.Forms.Platform.WP8/VisualElementRenderer.cs
@@ -144,9 +144,7 @@ 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
+ IVisualElementRenderer renderer = Platform.GetRenderer(child);
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 6036a1a..62c4918 100644
--- a/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj
+++ b/Xamarin.Forms.Platform.WP8/Xamarin.Forms.Platform.WP8.csproj
@@ -32,7 +32,8 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0219</NoWarn>
+ <NoWarn>
+ </NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -44,7 +45,8 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- <NoWarn>0114;4014;0219;0067</NoWarn>
+ <NoWarn>
+ </NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>