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

Commit

Permalink
Update PageRenderer.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
jfversluis committed Aug 6, 2020
1 parent 12d2d62 commit 39a77ab
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Xamarin.Forms.Platform.MacOS/Renderers/PageRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@ public override void UpdateLayer()

void UpdateBackground()
{
this.ApplyNativeImageAsync(Page.BackgroundImageSourceProperty, bgImage =>
_renderer.ApplyNativeImageAsync(Page.BackgroundImageSourceProperty, bgImage =>
{
if (bgImage != null)
{
View.Layer.BackgroundColor = NSColor.FromPatternImage(bgImage).CGColor;
Layer.BackgroundColor = NSColor.FromPatternImage(bgImage).CGColor;
}
else
{
Brush background = Element.Background;
Brush background = _renderer.Element.Background;
if (!Brush.IsNullOrEmpty(background))
NativeView.UpdateBackground(Element.Background);
_renderer.NativeView.UpdateBackground(_renderer.Element.Background);
else
{
Color bgColor = Element.BackgroundColor;
View.Layer.BackgroundColor = bgColor.IsDefault ? ColorExtensions.WindowBackgroundColor.CGColor : bgColor.ToCGColor();
Color bgColor = _renderer.Element.BackgroundColor;
Layer.BackgroundColor = bgColor.IsDefault ? ColorExtensions.WindowBackgroundColor.CGColor : bgColor.ToCGColor();
}
}
});
Expand Down

0 comments on commit 39a77ab

Please sign in to comment.