From cfb314bd4fe70c83f43bb254bcc1bdb54b2dc827 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Tue, 31 Jan 2017 15:58:52 +0100 Subject: move recurrent 'Caption' property in Templated Control --- src/GraphicObjects/TemplatedControl.cs | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/GraphicObjects/TemplatedControl.cs') diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs index cd645dd3..37a220cc 100644 --- a/src/GraphicObjects/TemplatedControl.cs +++ b/src/GraphicObjects/TemplatedControl.cs @@ -39,13 +39,9 @@ namespace Crow } #endregion - public override void Initialize () - { - loadTemplate (); - base.Initialize (); - } - string _template; + string caption; + [XmlAttributeAttribute][DefaultValue(null)] public string Template { get { return _template; } @@ -60,8 +56,22 @@ namespace Crow loadTemplate (CurrentInterface.Load (_template)); } } - + [XmlAttributeAttribute()][DefaultValue("Templated Control")] + public virtual string Caption { + get { return caption; } + set { + if (caption == value) + return; + caption = value; + NotifyValueChanged ("Caption", caption); + } + } #region GraphicObject overrides + public override void Initialize () + { + loadTemplate (); + base.Initialize (); + } public override GraphicObject FindByName (string nameToFind) { //prevent name searching in template -- cgit v1.3.1-4-g156e