[UWP] Rename ConvertExtensions to ColorExtensions and change access to public (#4558...
authorStephane Delcroix <stephane@delcroix.org>
Mon, 3 Dec 2018 12:49:09 +0000 (13:49 +0100)
committerRui Marinho <me@ruimarinho.net>
Mon, 3 Dec 2018 12:49:09 +0000 (12:49 +0000)
* Rename ConvertExtensions to ColorExtensions and change access to public

- fixes #1522
- closes #1535

* remove unused convertextensions

Xamarin.Forms.Platform.UAP/ColorExtensions.cs
Xamarin.Forms.Platform.UAP/ConvertExtensions.cs [deleted file]
Xamarin.Forms.Platform.UAP/Xamarin.Forms.Platform.UAP.csproj

index d8b5ae3..23d33f0 100644 (file)
@@ -4,7 +4,7 @@ using Windows.UI.Xaml.Media;
 
 namespace Xamarin.Forms.Platform.UWP
 {
-       internal static class ColorExtensions
+       public static class ColorExtensions
        {
                public static Windows.UI.Color GetContrastingColor(this Windows.UI.Color color)
                {
@@ -24,5 +24,15 @@ namespace Xamarin.Forms.Platform.UWP
                {
                        return solidColorBrush.Color.ToFormsColor();
                }
+
+               public static Brush ToBrush(this Color color)
+               {
+                       return new SolidColorBrush(color.ToWindowsColor());
+               }
+
+               public static Windows.UI.Color ToWindowsColor(this Color color)
+               {
+                       return Windows.UI.Color.FromArgb((byte)(color.A * 255), (byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255));
+               }
        }
-}
\ No newline at end of file
+}
diff --git a/Xamarin.Forms.Platform.UAP/ConvertExtensions.cs b/Xamarin.Forms.Platform.UAP/ConvertExtensions.cs
deleted file mode 100644 (file)
index a5b4ff1..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-using Windows.UI.Xaml.Media;
-
-namespace Xamarin.Forms.Platform.UWP
-{
-       internal static class ConvertExtensions
-       {
-               public static Brush ToBrush(this Color color)
-               {
-                       return new SolidColorBrush(color.ToWindowsColor());
-               }
-
-               public static Windows.UI.Color ToWindowsColor(this Color color)
-               {
-                       return Windows.UI.Color.FromArgb((byte)(color.A * 255), (byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255));
-               }
-       }
-}
\ No newline at end of file
index ff57b82..d660e95 100644 (file)
@@ -47,7 +47,6 @@
     <Compile Include="IImageVisualElementRenderer.cs" />
     <Compile Include="ImageButtonRenderer.cs" />
     <Compile Include="CollectionViewRenderer.cs" />
-    <Compile Include="ColorExtensions.cs" />
     <Compile Include="FormsCancelButton.cs" />
     <Compile Include="AlertDialog.cs" />
     <Compile Include="Items\ItemContentControl.cs" />
     <Compile Include="CellControl.cs" />
     <Compile Include="CollapseWhenEmptyConverter.cs" />
     <Compile Include="ColorConverter.cs" />
-    <Compile Include="ConvertExtensions.cs" />
+    <Compile Include="ColorExtensions.cs" />
     <Compile Include="DatePickerRenderer.cs" />
     <Compile Include="DefaultRenderer.cs" />
     <Compile Include="EditorRenderer.cs" />