diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2017-08-27 06:51:36 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2017-08-27 06:51:36 +0200 |
| commit | 6cbe9f9d2a604cdbb74f46f3710ea3dc60a87e55 (patch) | |
| tree | 7e3e675b2f6b14d320b124389b25fde003b63ea6 /src/GraphicObjects/TemplatedControl.cs | |
| parent | 3025ab70f5fc51819f5980908a8a98d5d6426b7e (diff) | |
first step in implementing a dispose mechanism for graphic objects
Diffstat (limited to 'src/GraphicObjects/TemplatedControl.cs')
| -rw-r--r-- | src/GraphicObjects/TemplatedControl.cs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs index b0d752ed..ba580dae 100644 --- a/src/GraphicObjects/TemplatedControl.cs +++ b/src/GraphicObjects/TemplatedControl.cs @@ -48,6 +48,9 @@ namespace Crow string _template; string caption; + /// <summary> + /// Template path + /// </summary> [XmlAttributeAttribute][DefaultValue(null)] public string Template { get { return _template; } @@ -99,6 +102,9 @@ namespace Crow protected virtual void loadTemplate(GraphicObject template = null) { + if (this.child != null)//template change, bindings has to be reset + this.ClearTemplateBinding(); + if (template == null) { if (!Interface.DefaultTemplates.ContainsKey (this.GetType ().FullName)) throw new Exception (string.Format ("No default template found for '{0}'", this.GetType ().FullName)); |