diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-25 16:56:39 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-25 16:56:39 +0100 |
| commit | 76edc3ce44583ee8160ea207dfeb17c4d6508e59 (patch) | |
| tree | 52fa14876f1d155b6beae946c459c5bae35a81c9 /src | |
| parent | 3cb3ae624a352b92b71a5d7cb19c05f0183f2e43 (diff) | |
expandable image visibility <= Expandable.HasContent property
Diffstat (limited to 'src')
| -rw-r--r-- | src/GraphicObjects/Expandable.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/GraphicObjects/Expandable.cs b/src/GraphicObjects/Expandable.cs index 3593bf90..16b3e974 100644 --- a/src/GraphicObjects/Expandable.cs +++ b/src/GraphicObjects/Expandable.cs @@ -41,6 +41,7 @@ namespace Crow } set { _contentContainer.SetChild(value); + NotifyValueChanged ("HasContent", HasContent); } } protected override void loadTemplate(GraphicObject template = null) @@ -85,8 +86,12 @@ namespace Crow { if (value == _isExpanded) return; - + _isExpanded = value; + + if (!HasContent) + _isExpanded = false; + NotifyValueChanged ("IsExpanded", _isExpanded); if (_isExpanded) @@ -95,6 +100,10 @@ namespace Crow onCollapse (this, null); } } + [XmlIgnore]public bool HasContent { + get { return _contentContainer == null ? false : _contentContainer.Child != null; } + } + #endregion public virtual void onExpand(object sender, EventArgs e) |