Skip to content

Commit

Permalink
fix: throw an exception if Shadow is used on xamarin + winUI targets
Browse files Browse the repository at this point in the history
  • Loading branch information
pictos committed Aug 18, 2023
1 parent 636740c commit 2cb7164
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ public partial class ShadowContainer : ContentControl

public ShadowContainer()
{
#if HAS_UNO_WINUI && !NET6_0_OR_GREATER
throw new NotSupportedException("ShadowContainer doesn't support Xamarin + WinUI considering moving to .NET6 or greater.");
#else
DefaultStyleKey = typeof(ShadowContainer);

_cornerRadius = new CornerRadius(0);

Loaded += ShadowContainerLoaded;
Unloaded += ShadowContainerUnloaded;
#endif
}

private void ShadowContainerUnloaded(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -119,7 +123,7 @@ protected override void OnContentChanged(object oldContent, object newContent)
ContentPresenter _ => ContentPresenter.CornerRadiusProperty,
Border _ => Border.CornerRadiusProperty,
Control _ => Control.CornerRadiusProperty,
RelativePanel _ => RelativePanel.CornerRadiusProperty,
RelativePanel _ => RelativePanel.CornerRadiusProperty,
_ => default,

};
Expand Down

0 comments on commit 2cb7164

Please sign in to comment.