aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/GraphicObject.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-15 11:10:10 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-15 11:15:39 +0100
commit93fd22a23a4b1c611f0f7e9defecfed0c78ef0dc (patch)
tree9f86c9885833f76bc60a59753b5ea605fff83b71 /src/GraphicObjects/GraphicObject.cs
parent6ef48fcf1da0116e25e005ea55e698df51253f3c (diff)
add SizePolicy properties
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
-rw-r--r--src/GraphicObjects/GraphicObject.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 89110ab8..02e5c863 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -240,6 +240,8 @@ namespace Crow
Bounds.Width = value;
NotifyValueChanged ("Width", Bounds.Width);
+ NotifyValueChanged ("WidthPolicy", WidthPolicy);
+
this.RegisterForLayouting (LayoutingType.Width);
}
}
@@ -252,9 +254,14 @@ namespace Crow
Bounds.Height = value;
NotifyValueChanged ("Height", Bounds.Height);
+ NotifyValueChanged ("HeightPolicy", HeightPolicy);
+
this.RegisterForLayouting (LayoutingType.Height);
}
}
+ [XmlIgnore]public virtual int WidthPolicy { get { return Width < 1 ? Width : 0; } }
+ [XmlIgnore]public virtual int HeightPolicy { get { return Height < 1 ? Height : 0; } }
+
[XmlAttributeAttribute()][DefaultValue(false)]
public virtual bool Fit {
get { return Bounds.Width < 0 && Bounds.Height < 0 ? true : false; }