diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-17 00:53:59 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-17 00:53:59 +0100 |
| commit | a8a5562df0358b314197f3685fc7622ecfd307d0 (patch) | |
| tree | 02cdd70b6b0f999dd2a2eab7bf8018da03ffdd9f /src/GraphicObjects/TemplatedControl.cs | |
| parent | 61d1d07d37a5cc9d6ae1c4fcc333ec8ae644aca3 (diff) | |
splitted measure with fault checking, changing default template sizing to 0, lots of bugs.
Diffstat (limited to 'src/GraphicObjects/TemplatedControl.cs')
| -rw-r--r-- | src/GraphicObjects/TemplatedControl.cs | 61 |
1 files changed, 35 insertions, 26 deletions
diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs index dd7c742d..75176c34 100644 --- a/src/GraphicObjects/TemplatedControl.cs +++ b/src/GraphicObjects/TemplatedControl.cs @@ -71,38 +71,47 @@ namespace Crow string _template; - [XmlAttributeAttribute][DefaultValue("#Crow.Templates.Template.goml")] + [XmlAttributeAttribute][DefaultValue(null)] public string Template { get { return _template; } - set { _template = value; } - } + set { + if (Template == value) + return; + _template = value; - #region GraphicObject overrides - [XmlAttributeAttribute()][DefaultValue(-1)] - public override int Width { - get { return base.Width; } - set { - base.Width = value; - //PropertyLess binding for sizing policy in template - if (base.Width < 1) //send size policy to template elements - NotifyValueChanged ("TemplatedWidth", base.Width); - else //stretched in control if size is fixed - NotifyValueChanged ("TemplatedWidth", 0); + if (string.IsNullOrEmpty(_template)) + loadTemplate (); + else + loadTemplate (Interface.Load (_template, this)); } } - [XmlAttributeAttribute()][DefaultValue(-1)] - public override int Height { - get { return base.Height; } - set { - base.Height = value; - //PropertyLess binding for sizing policy in template - if (base.Height < 1) //send size policy to template elements - NotifyValueChanged ("TemplatedHeight", base.Height); - else //stretched in control if size is fixed - NotifyValueChanged ("TemplatedHeight", 0); - } - } + #region GraphicObject overrides +// [XmlAttributeAttribute()][DefaultValue(-1)] +// public override int Width { +// get { return base.Width; } +// set { +// base.Width = value; +// //PropertyLess binding for sizing policy in template +// if (base.Width < 1) //send size policy to template elements +// NotifyValueChanged ("TemplatedWidth", base.Width); +// else //stretched in control if size is fixed +// NotifyValueChanged ("TemplatedWidth", 0); +// } +// } +// [XmlAttributeAttribute()][DefaultValue(-1)] +// public override int Height { +// get { return base.Height; } +// set { +// base.Height = value; +// +// //PropertyLess binding for sizing policy in template +// if (base.Height < 1) //send size policy to template elements +// NotifyValueChanged ("TemplatedHeight", base.Height); +// else //stretched in control if size is fixed +// NotifyValueChanged ("TemplatedHeight", 0); +// } +// } public override GraphicObject FindByName (string nameToFind) { //prevent name searching in template |