diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-20 17:40:01 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-09-01 12:44:39 +0200 |
| commit | 417c7100b779d79a3bc71ec7adbf3528f9b05c92 (patch) | |
| tree | 805d42323898f013485ed20adb19b32398600981 /src/GraphicObjects/TemplatedGroup.cs | |
| parent | befffb69eaebf2e607d88cd3ffc956a708d5734e (diff) | |
Can't pop is no submenu on node
modifié : Templates/MenuItem.template
modifié : src/GraphicObjects/MenuItem.cs
add CanPop property
modifié : src/GraphicObjects/Popper.cs
add 'HasChildren' propertyless binding
modifié : src/GraphicObjects/TemplatedGroup.cs
Diffstat (limited to 'src/GraphicObjects/TemplatedGroup.cs')
| -rw-r--r-- | src/GraphicObjects/TemplatedGroup.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/GraphicObjects/TemplatedGroup.cs b/src/GraphicObjects/TemplatedGroup.cs index cee4adea..704b59af 100644 --- a/src/GraphicObjects/TemplatedGroup.cs +++ b/src/GraphicObjects/TemplatedGroup.cs @@ -38,16 +38,20 @@ namespace Crow public virtual void AddItem(GraphicObject g){ items.AddChild (g); + NotifyValueChanged ("HasChildren", true); //g.LogicalParent = this; } public virtual void RemoveItem(GraphicObject g) { items.RemoveChild (g); + if (items.Children.Count == 0) + NotifyValueChanged ("HasChildren", false); } public virtual void ClearItems() { items.ClearChildren (); + NotifyValueChanged ("HasChildren", false); } protected override void loadTemplate(GraphicObject template = null) @@ -57,6 +61,10 @@ namespace Crow items = this.child.FindByName ("ItemsContainer") as Group; if (items == null) throw new Exception ("TemplatedGroup template Must contain a Group named 'ItemsContainer'"); + if (items.Children.Count == 0) + NotifyValueChanged ("HasChildren", false); + else + NotifyValueChanged ("HasChildren", true); } #region GraphicObject overrides |