MouseClick="../onMouseClick">
<VerticalStack Height="{../../HeightPolicy}" Width="{../../WidthPolicy}">
<HorizontalStack Spacing="1" Height="-1" Width="{../../../WidthPolicy}">
- <Image Margin="2" Width="12" Height="12" Path="{../../../../Image}" SvgSub="{../../../../IsExpanded}"/>
+ <Image Margin="2" Width="12" Height="12"
+ Visible="{../../../../HasContent}"
+ Path="{../../../../Image}"
+ SvgSub="{../../../../IsExpanded}"/>
<Label Text="{../../../../Caption}" Width="{../../../../WidthPolicy}"/>
</HorizontalStack>
<Container Name="Content" Visible="false"
<?xml version="1.0"?>
<Expandable Fit="true" Caption="Test expandable" Background="DimGray">
- <VerticalStack Margin="5" Background="Green" Fit="true">
+<!-- <VerticalStack Margin="5" Background="Green" Fit="true">
<CheckBox Name="chk1" Background="Red" Fit="true"/>
<CheckBox Name="chk2" IsChecked="true" Fit="true"/>
<CheckBox Name="chk3" Fit="true"/>
<CheckBox Name="chk4" Fit="true"/>
-<!-- <HorizontalStack Fit="true" Margin="2" Background="Blue">
+ <HorizontalStack Fit="true" Margin="2" Background="Blue">
<Label Name="captionFps" Text="Fps:" Width="30" TextAlignment="Right"/>
<Label Name="valueFps" Text="{fps}" Font="droid , 12" Width="-1" TextAlignment="Center" Background="AoEnglish"/>
- </HorizontalStack>-->
- </VerticalStack>
+ </HorizontalStack>
+ </VerticalStack>-->
</Expandable>
}
set {
_contentContainer.SetChild(value);
+ NotifyValueChanged ("HasContent", HasContent);
}
}
protected override void loadTemplate(GraphicObject template = null)
{
if (value == _isExpanded)
return;
-
+
_isExpanded = value;
+
+ if (!HasContent)
+ _isExpanded = false;
+
NotifyValueChanged ("IsExpanded", _isExpanded);
if (_isExpanded)
onCollapse (this, null);
}
}
+ [XmlIgnore]public bool HasContent {
+ get { return _contentContainer == null ? false : _contentContainer.Child != null; }
+ }
+
#endregion
public virtual void onExpand(object sender, EventArgs e)