aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects/Expandable.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2015-06-10 16:10:18 +0200
committerjpbruyere <jp.bruyere@hotmail.com>2015-06-10 16:10:18 +0200
commit04f0def856c8ff46ad63cd5976a1299c0b91ac44 (patch)
tree274f83dc92712d8352b7949551e9eefcb66ad291 /src/GraphicObjects/Expandable.cs
parent73c7ac95b12d72bcb3f5d549c76bdf0b5a093847 (diff)
- template attribute (in xml, and in c# for default one
Diffstat (limited to 'src/GraphicObjects/Expandable.cs')
-rw-r--r--src/GraphicObjects/Expandable.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/GraphicObjects/Expandable.cs b/src/GraphicObjects/Expandable.cs
index 6f215b2f..5bf535a4 100644
--- a/src/GraphicObjects/Expandable.cs
+++ b/src/GraphicObjects/Expandable.cs
@@ -18,6 +18,7 @@ using System.IO;
namespace go
{
+ [DefaultTemplate("#go.Templates.Expandable.goml")]
public class Expandable : TemplatedControl
{
bool _isExpanded;
@@ -35,10 +36,7 @@ namespace go
protected override void loadTemplate(GraphicObject template = null)
{
- if (template == null)
- this.SetChild (Interface.Load ("#go.Templates.Expandable.goml",this));
- else
- this.SetChild (template);
+ base.loadTemplate (template);
_caption = this.child.FindByName ("Caption") as Label;
Content = this.child.FindByName ("Content") as Container;
@@ -47,6 +45,7 @@ namespace go
if (_image == null)
return;
_image.SvgSub = "collapsed";
+
this.Expand += (object sender, EventArgs e) => {_image.SvgSub = "expanded";};
this.Collapse += (object sender, EventArgs e) => {_image.SvgSub = "collapsed";};