From 93fd22a23a4b1c611f0f7e9defecfed0c78ef0dc Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Mon, 15 Feb 2016 11:10:10 +0100 Subject: [PATCH] add SizePolicy properties --- src/GraphicObjects/GraphicObject.cs | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- 2.47.3