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:
authorDominique Louis <dominique@yen-x1-31.fareast.corp.microsoft.com>2018-12-02 11:36:19 +0300
committerDominique Louis <dominique@yen-x1-31.fareast.corp.microsoft.com>2018-12-02 11:52:09 +0300
commit2f16fd1451e3e7c9adcca9fe852fe767834468be (patch)
tree071efa534ea30fa170ea1201bde9c01f053ad496 /Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
parent794123986062cb0a8ab2885bbb449bb62f9f13ad (diff)
[Mac] Remove DoConstraints dependency and use NSLayoutConstraint.Create calls directly. Should be slightly faster on startup.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs21
1 files changed, 12 insertions, 9 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
index b9deb09..97f9c05 100644
--- a/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
+++ b/Xamarin.PropertyEditing.Mac/Controls/BaseRectangleEditorControl.cs
@@ -58,15 +58,18 @@ namespace Xamarin.PropertyEditing.Mac
AddSubview (HeightLabel);
AddSubview (HeightEditor);
- this.DoConstraints (new[] {
- XEditor.ConstraintTo (this, (xe, c) => xe.Width == 90),
- XEditor.ConstraintTo (this, (xe, c) => xe.Height == DefaultControlHeight),
- YEditor.ConstraintTo (this, (ye, c) => ye.Width == 90),
- YEditor.ConstraintTo (this, (ye, c) => ye.Height == DefaultControlHeight),
- WidthEditor.ConstraintTo (this, (we, c) => we.Width == 90),
- WidthEditor.ConstraintTo (this, (we, c) => we.Height == DefaultControlHeight),
- HeightEditor.ConstraintTo (this, (he, c) => he.Width == 90),
- HeightEditor.ConstraintTo (this, (he, c) => he.Height == DefaultControlHeight),
+ this.AddConstraints (new[] {
+ NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
+ NSLayoutConstraint.Create (XEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
+
+ NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
+ NSLayoutConstraint.Create (YEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
+
+ NSLayoutConstraint.Create (WidthEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
+ NSLayoutConstraint.Create (WidthEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
+
+ NSLayoutConstraint.Create (HeightEditor, NSLayoutAttribute.Width, NSLayoutRelation.Equal, 1f, 90f),
+ NSLayoutConstraint.Create (HeightEditor, NSLayoutAttribute.Height, NSLayoutRelation.Equal, 1f, DefaultControlHeight),
});
UpdateTheme ();