Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Attempt to fix UWP target regression #1238

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using Windows.Foundation.Metadata;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
Expand Down Expand Up @@ -176,7 +178,12 @@ void SetColor()

#if UWP_18362
if (Element.Color == Color.Transparent)
flyoutStyle.Setters.Add(new Windows.UI.Xaml.Setter(FlyoutPresenter.IsDefaultShadowEnabledProperty, false));
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.FlyoutPresenter", "IsDefaultShadowEnabled"))
{
flyoutStyle.Setters.Add(new Windows.UI.Xaml.Setter(FlyoutPresenter.IsDefaultShadowEnabledProperty, false));
}
}
#endif
}

Expand All @@ -191,13 +198,13 @@ void Show()
{
if (Element?.Anchor != null)
{
var anchor = Platform.GetRenderer(Element.Anchor).ContainerElement;
var anchor = Forms.Platform.UWP.Platform.GetRenderer(Element.Anchor).ContainerElement;
FlyoutBase.SetAttachedFlyout(anchor, this);
FlyoutBase.ShowAttachedFlyout(anchor);
}
else
{
var frameworkElement = Platform.GetRenderer(Element?.Parent as VisualElement)?.ContainerElement;
var frameworkElement = Forms.Platform.UWP.Platform.GetRenderer(Element?.Parent as VisualElement)?.ContainerElement;
FlyoutBase.SetAttachedFlyout(frameworkElement, this);
FlyoutBase.ShowAttachedFlyout(frameworkElement);
}
Expand Down