[UWP] fixes crash after reset text color (#6435)
authorPavel Yakovlev <v-payako@microsoft.com>
Wed, 3 Jul 2019 23:24:57 +0000 (02:24 +0300)
committerSamantha Houts <samhouts@users.noreply.github.com>
Wed, 3 Jul 2019 23:24:57 +0000 (16:24 -0700)
Xamarin.Forms.Platform.UAP/FrameRenderer.cs

index 08f6ab1..8de526f 100644 (file)
@@ -64,15 +64,8 @@ namespace Xamarin.Forms.Platform.UWP
                        Color backgroundColor = Element.BackgroundColor;
                        if (Control != null)
                        {
-                               if (!backgroundColor.IsDefault)
-                               {
-                                       Control.Background = backgroundColor.ToBrush();
-                               }
-                               else
-                               {
-                                       Control.ClearValue(BackgroundProperty);
-                               }
-                       }                       
+                               Control.Background = backgroundColor.IsDefault ? null : backgroundColor.ToBrush();
+                       }
                }
 
                void PackChild()