diff --git a/src/Uno.UI.Toolkit/ElevatedView.cs b/src/Uno.UI.Toolkit/ElevatedView.cs index ff90a83f2f0e..eb0998226abe 100644 --- a/src/Uno.UI.Toolkit/ElevatedView.cs +++ b/src/Uno.UI.Toolkit/ElevatedView.cs @@ -20,7 +20,7 @@ namespace Uno.UI.Toolkit [TemplatePart(Name = "PART_Border", Type = typeof(Border))] [TemplatePart(Name = "PART_ShadowHost", Type = typeof(Grid))] public sealed partial class ElevatedView : Control -#if !NETFX_CORE && !NETCOREAPP +#if HAS_UNO , ICustomClippingElement #endif { @@ -59,7 +59,7 @@ public ElevatedView() { DefaultStyleKey = typeof(ElevatedView); -#if !NETFX_CORE && !NETCOREAPP +#if HAS_UNO Loaded += (snd, evt) => SynchronizeContentTemplatedParent(); // Patch to deactivate the clipping by ContentControl @@ -114,7 +114,7 @@ public object ElevatedContent set => SetValue(ElevatedContentProperty, value); } -#if !NETFX_CORE && !NETCOREAPP +#if HAS_UNO public new static DependencyProperty BackgroundProperty { get ; } = DependencyProperty.Register( "Background", typeof(Brush), @@ -178,7 +178,7 @@ private void UpdateElevation() return; // not initialized yet } -#if !NETFX_CORE && !NETCOREAPP +#if HAS_UNO SynchronizeContentTemplatedParent(); #endif @@ -199,13 +199,13 @@ private void UpdateElevation() _border.SetElevationInternal(Elevation, ShadowColor); #elif __SKIA__ this.SetElevationInternal(Elevation, ShadowColor); -#elif NETFX_CORE || NETCOREAPP +#elif (NETFX_CORE || NETCOREAPP) && !HAS_UNO _border.SetElevationInternal(Elevation, ShadowColor, _shadowHost as DependencyObject, CornerRadius); #endif } } -#if !NETFX_CORE && !NETCOREAPP +#if HAS_UNO bool ICustomClippingElement.AllowClippingToLayoutSlot => false; // Never clip, since it will remove the shadow bool ICustomClippingElement.ForceClippingToLayoutSlot => false; diff --git a/src/Uno.UI.Toolkit/UIElementExtensions.cs b/src/Uno.UI.Toolkit/UIElementExtensions.cs index 6bbab6049b97..5751226bc1e3 100644 --- a/src/Uno.UI.Toolkit/UIElementExtensions.cs +++ b/src/Uno.UI.Toolkit/UIElementExtensions.cs @@ -15,7 +15,7 @@ using Uno.Foundation.Logging; #endif -#if NETCOREAPP +#if NETCOREAPP && !HAS_UNO using Microsoft.UI; #endif @@ -75,7 +75,7 @@ private static void OnElevationChanged(DependencyObject dependencyObject, #if __IOS__ || __MACOS__ internal static void SetElevationInternal(this DependencyObject element, double elevation, Color shadowColor, CGPath path = null) -#elif NETFX_CORE || NETCOREAPP +#elif (NETFX_CORE || NETCOREAPP) && !HAS_UNO internal static void SetElevationInternal(this DependencyObject element, double elevation, Color shadowColor, DependencyObject host = null, CornerRadius cornerRadius = default(CornerRadius)) #else internal static void SetElevationInternal(this DependencyObject element, double elevation, Color shadowColor) @@ -163,7 +163,7 @@ internal static void SetElevationInternal(this DependencyObject element, double var shadow = new ShadowState(dx, dy, sigmaX, sigmaY, shadowColor); visual.ShadowState = shadow; } -#elif NETFX_CORE || NETCOREAPP +#elif (NETFX_CORE || NETCOREAPP) && !HAS_UNO if (element is UIElement uiElement) { var compositor = ElementCompositionPreview.GetElementVisual(uiElement).Compositor; @@ -236,7 +236,7 @@ internal static void SetElevationInternal(this DependencyObject element, double #endif } -#endregion + #endregion internal static Thickness GetPadding(this UIElement uiElement) { @@ -354,7 +354,7 @@ internal static DependencyProperty FindDependencyPropertyUsingReflection