aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/TemplatedControl.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2017-09-11 18:03:35 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2017-09-11 18:03:35 +0200
commitdc8d870b76c445b6ef979ff58c2260e88793d167 (patch)
treeab0b76d5fbf180a1afc3bdf62c1b74a129496688 /src/GraphicObjects/TemplatedControl.cs
parent7f10fe9ea2a4538843401c54d4518376a69b242d (diff)
revert 65cf1452510c336fcd69f9922774389d6c3b1aee, to allow widget creation from code
Diffstat (limited to 'src/GraphicObjects/TemplatedControl.cs')
-rw-r--r--src/GraphicObjects/TemplatedControl.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs
index ba580dae..c4ef5788 100644
--- a/src/GraphicObjects/TemplatedControl.cs
+++ b/src/GraphicObjects/TemplatedControl.cs
@@ -62,7 +62,7 @@ namespace Crow
if (string.IsNullOrEmpty(_template))
loadTemplate ();
else
- loadTemplate (currentInterface.Load (_template));
+ loadTemplate (CurrentInterface.Load (_template));
}
}
[XmlAttributeAttribute()][DefaultValue("Templated Control")]
@@ -76,6 +76,11 @@ namespace Crow
}
}
#region GraphicObject overrides
+ public override void Initialize ()
+ {
+ loadTemplate ();
+ base.Initialize ();
+ }
public override GraphicObject FindByName (string nameToFind)
{
//prevent name searching in template
@@ -108,7 +113,7 @@ namespace Crow
if (template == null) {
if (!Interface.DefaultTemplates.ContainsKey (this.GetType ().FullName))
throw new Exception (string.Format ("No default template found for '{0}'", this.GetType ().FullName));
- this.SetChild (currentInterface.Load (Interface.DefaultTemplates[this.GetType ().FullName]));
+ this.SetChild (CurrentInterface.Load (Interface.DefaultTemplates[this.GetType ().FullName]));
}else
this.SetChild (template);
}