]> O.S.I.I.S - jp/crow.git/commitdiff
add SizePolicy properties
authorjpbruyere <jp.bruyere@hotmail.com>
Mon, 15 Feb 2016 10:10:10 +0000 (11:10 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Mon, 15 Feb 2016 10:15:39 +0000 (11:15 +0100)
src/GraphicObjects/GraphicObject.cs

index 89110ab81e2b4d937eb73d4ed8dab4d5723be020..02e5c863da29d95b8029a94917b0bcb44b9cb2e0 100644 (file)
@@ -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; }