diff options
author | E.Z. Hart <hartez@users.noreply.github.com> | 2017-02-03 11:13:53 -0700 |
---|---|---|
committer | Samantha Houts <samantha@teamredwall.com> | 2017-02-03 10:13:53 -0800 |
commit | 5af224a1e7679a618149ecac2aa0d8b7eb6cb629 (patch) | |
tree | 9ff345804719d5a513fc6b6b2e92b68f48119fe0 /Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs | |
parent | a67b176051196dfee3a7c1a6b88e257f84136fff (diff) | |
download | xamarin-forms-5af224a1e7679a618149ecac2aa0d8b7eb6cb629.tar.gz xamarin-forms-5af224a1e7679a618149ecac2aa0d8b7eb6cb629.tar.bz2 xamarin-forms-5af224a1e7679a618149ecac2aa0d8b7eb6cb629.zip |
Fix disappearing ListView text when changing color settings on Windows (#731)
* repro
* Checkpoint
* Checkpoint
* Remove now-unnecessary hacks for Time- and DatePicker
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs')
-rw-r--r-- | Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs b/Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs index 3d5906dc..15124258 100644 --- a/Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs +++ b/Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs @@ -2,7 +2,6 @@ using Windows.Foundation; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; -using Xamarin.Forms.Internals; #if WINDOWS_UWP @@ -38,11 +37,11 @@ namespace Xamarin.Forms.Platform.WinRT throw new NotSupportedException(); } - class WrapperControl : ContentControl + class WrapperControl : Canvas { readonly View _view; - FrameworkElement FrameworkElement => Content as FrameworkElement; + FrameworkElement FrameworkElement { get; } public WrapperControl(View view) { @@ -52,9 +51,8 @@ namespace Xamarin.Forms.Platform.WinRT IVisualElementRenderer renderer = Platform.CreateRenderer(view); Platform.SetRenderer(view, renderer); - NotifyWrapperAwareDescendants(view, renderer); - - Content = renderer.ContainerElement; + FrameworkElement = renderer.ContainerElement; + Children.Add(renderer.ContainerElement); // make sure we re-measure once the template is applied if (FrameworkElement != null) @@ -100,25 +98,6 @@ namespace Xamarin.Forms.Platform.WinRT return result; } - - void NotifyWrapperAwareDescendants(Element currentView, IVisualElementRenderer currentRenderer) - { - // If any of the child renderers need to handle anything differently because they're in - // a wrapper in a list view, let them know that they're being wrapped - var wrapperAwareRenderer = currentRenderer as IWrapperAware; - wrapperAwareRenderer?.NotifyWrapped(); - - foreach (Element child in ((IElementController)currentView).LogicalChildren) - { - var childView = child as View; - if (childView == null) - { - continue; - } - - NotifyWrapperAwareDescendants(childView, Platform.GetRenderer(childView)); - } - } } } }
\ No newline at end of file |