<?xml version="1.0"?>
-<HorizontalStack Name="hstack" Margin="0" Spacing="0" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
+<HorizontalStack MinimumSize="40;10" Name="hstack" Margin="0" Spacing="0" Height="{../HeightPolicy}" Width="{../WidthPolicy}">
<Border BorderWidth="1" Height="{../../HeightPolicy}" Width="80%" Background="White"
Foreground="DimGray" Margin="0">
<Label Foreground="DimGray" Height="{../../../HeightPolicy}" Width="Stretched"
Text="{../../../Value}" TextAlignment="Right" Margin="0"/>
</Border>
- <VerticalStack Width="20%" Height="Stretched" Spacing="0" Margin="0" Background="Red">
+ <VerticalStack MinimumSize="8;10" Width="20%" Height="Stretched" Spacing="0" Margin="0" Background="Red">
<Button MouseRepeat="true" Width="Stretched" Height="50%" Margin="0" MouseClick="../../../onUp"
Template="#Crow.Templates.ArrowButTemplate.crow">
<Image Path="#Crow.Images.Icons.updown.svg" SvgSub="up" Margin="0"/>
<?xml version="1.0"?>
-<VerticalStack Name="TopContainer" Width="400" Height="-1"
+<VerticalStack Name="TopContainer" Width="400" Height="Fit"
Margin="20" Background="DarkGray">
<HorizontalStack Fit="true" Margin="5" Background="SkyBlue">
else if (Width == Measure.Stretched)
Slot.Width = Parent.ClientRectangle.Width;
else
- Slot.Width = Parent.ClientRectangle.Width * Width / 100;
+ Slot.Width = (int)Math.Round((double)(Parent.ClientRectangle.Width * Width) / 100.0);
if (Slot.Width == int.MinValue)
return false;
else if (Height == Measure.Stretched)
Slot.Height = Parent.ClientRectangle.Height;
else
- Slot.Height = Parent.ClientRectangle.Height * Height.Value / 100;
+ Slot.Height = (int)Math.Round((double)(Parent.ClientRectangle.Height * Height) / 100.0);
if (Slot.Height == int.MinValue)
return false;
[XmlIgnore]
public int MaximumScroll {
get {
- return VerticalScrolling ?
- child == null ? 0 : Math.Max(Child.Slot.Height - ClientRectangle.Height,0) :
- Math.Max(Child.Slot.Width - ClientRectangle.Width,0);
+ try {
+ return VerticalScrolling ?
+ Math.Max(Child.Slot.Height - ClientRectangle.Height,0) :
+ Math.Max(Child.Slot.Width - ClientRectangle.Width,0);
+ } catch {
+ return 0;
+ }
}
}
: base(){}
#region GraphicObject Overrides
+ //TODO:put this override in style
[XmlAttributeAttribute()][DefaultValue(false)]
public override bool CacheEnabled {
get { return base.CacheEnabled; }