From: jpbruyere Date: Mon, 15 Feb 2016 10:10:10 +0000 (+0100) Subject: add SizePolicy properties X-Git-Tag: v0.4~127^2~23 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=93fd22a23a4b1c611f0f7e9defecfed0c78ef0dc;p=jp%2Fcrow.git add SizePolicy properties --- 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; }