diff --git a/src/Uno.UI/UI/ColorHelper.cs b/src/Uno.UI/UI/ColorHelper.cs index 4df6787fb020..aa80035a01d5 100644 --- a/src/Uno.UI/UI/ColorHelper.cs +++ b/src/Uno.UI/UI/ColorHelper.cs @@ -1,9 +1,11 @@ -using System; +// On the UWP branch, only include this file in Uno.UWP (as public Window.whatever). On the WinUI branch, include it in both Uno.UWP (internal as Windows.whatever) and Uno.UI (public as Microsoft.whatever) +#if HAS_UNO_WINUI || !IS_UNO_UI_PROJECT +using System; using System.ComponentModel; using Uno.Extensions; using WindowsColor = Windows/*Intentional space for WinUI upgrade tool*/.UI.Color; -#if HAS_UNO_WINUI && IS_UNO_UI_PROJECT +#if IS_UNO_UI_PROJECT namespace Microsoft.UI.Text; #else namespace Windows.UI.Text; @@ -357,7 +359,7 @@ public static WindowsColor FromArgb(byte a, byte r, byte g, byte b) ]; #endregion - private unsafe static uint GetColorNameResourceId(WindowsColor color) + private static uint GetColorNameResourceId(WindowsColor color) { var hsl = color.ToHsl(); double h = hsl.H * 255.0; @@ -428,3 +430,4 @@ private unsafe static uint GetColorNameResourceId(WindowsColor color) } } } +#endif diff --git a/src/Uno.UI/UI/Colors.cs b/src/Uno.UI/UI/Colors.cs index 963bb0d574c5..438266dca91c 100644 --- a/src/Uno.UI/UI/Colors.cs +++ b/src/Uno.UI/UI/Colors.cs @@ -1,10 +1,12 @@ -using System; +// On the UWP branch, only include this file in Uno.UWP (as public Window.whatever). On the WinUI branch, include it in both Uno.UWP (internal as Windows.whatever) and Uno.UI (public as Microsoft.whatever) +#if HAS_UNO_WINUI || !IS_UNO_UI_PROJECT +using System; using System.Collections.Generic; using System.Text; using Color = global::Windows/*Intentional space for WinUI upgrade tool*/.UI.Color; -#if HAS_UNO_WINUI && IS_UNO_UI_PROJECT +#if IS_UNO_UI_PROJECT namespace Microsoft.UI #else namespace Windows.UI @@ -564,3 +566,4 @@ private static byte ToByte(char c) public static Color YellowGreen => _yellowGreen ??= FromInteger(unchecked((int)0xFF9ACD32)); } } +#endif diff --git a/src/Uno.UI/UI/Text/FontWeights.cs b/src/Uno.UI/UI/Text/FontWeights.cs index 473186f8cfd7..e0ad16cd18fb 100644 --- a/src/Uno.UI/UI/Text/FontWeights.cs +++ b/src/Uno.UI/UI/Text/FontWeights.cs @@ -1,8 +1,10 @@ -using System; +// On the UWP branch, only include this file in Uno.UWP (as public Window.whatever). On the WinUI branch, include it in both Uno.UWP (internal as Windows.whatever) and Uno.UI (public as Microsoft.whatever) +#if HAS_UNO_WINUI || !IS_UNO_UI_PROJECT +using System; using System.Collections.Generic; using System.Text; -#if HAS_UNO_WINUI && IS_UNO_UI_PROJECT +#if IS_UNO_UI_PROJECT using Windows.UI.Text; namespace Microsoft.UI.Text #else @@ -47,3 +49,4 @@ partial class FontWeights public static FontWeight UltraBlack => _extraBlack ??= new FontWeight(950); } } +#endif