Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBret Johnson <bret.johnson@microsoft.com>2022-02-03 19:36:06 +0300
committerGitHub <noreply@github.com>2022-02-03 19:36:06 +0300
commit78bc24fb825b0a6af277930105f8ef8b85163e78 (patch)
tree22d3784f6e0dfe71c41e2d10cab14bce825d1928
parentbb51ee49a85a34fb86c9da12473a62fa241f0613 (diff)
parentc0f4d68b053b50e9157fbfef150e4589c1f3100e (diff)
Merge pull request #787 from xamarin/dev/mkrueger/fix-1455310
Fixed NSColor dispose side effect.
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicBox.cs16
1 files changed, 7 insertions, 9 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicBox.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicBox.cs
index 7a6aedd..d836877 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicBox.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/DynamicBox.cs
@@ -14,14 +14,14 @@ namespace Xamarin.PropertyEditing.Mac
BorderWidth = 0;
BoxType = NSBoxType.NSBoxCustom;
TranslatesAutoresizingMaskIntoConstraints = false;
-
+ this.WantsLayer = true;
this.fillColor = fillName;
if (fillName == null)
- FillColor = NSColor.Clear;
+ this.Layer.BackgroundColor = NSColor.Clear.CGColor;
this.borderColor = borderName;
if (borderName == null)
- BorderColor = NSColor.Clear;
+ this.Layer.BorderColor = NSColor.Clear.CGColor;
HostResourceProvider = hostResources;
}
@@ -43,7 +43,7 @@ namespace Xamarin.PropertyEditing.Mac
{
this.fillColor = value;
if (value == null)
- FillColor = NSColor.Clear;
+ this.Layer.BackgroundColor = NSColor.Clear.CGColor;
AppearanceChanged ();
}
@@ -56,7 +56,7 @@ namespace Xamarin.PropertyEditing.Mac
{
this.borderColor = value;
if (value == null)
- BorderColor = NSColor.Clear;
+ this.Layer.BorderColor = NSColor.Clear.CGColor;
AppearanceChanged ();
}
@@ -78,16 +78,14 @@ namespace Xamarin.PropertyEditing.Mac
NSColor color = this.hostResources.GetNamedColor (this.fillColor);
if (color == null)
return;
-
- FillColor = color;
+ this.Layer.BackgroundColor = color.CGColor;
}
if (this.borderColor != null) {
NSColor color = this.hostResources.GetNamedColor (this.borderColor);
if (color == null)
return;
-
- BorderColor = color;
+ this.Layer.BorderColor = color.CGColor;
}
}
}