mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
Hide items measured 0,0
This commit is contained in:
parent
00ecbbf090
commit
39f5dac4bd
1 changed files with 11 additions and 2 deletions
|
@ -19,11 +19,20 @@ namespace CalculatorApp.Controls
|
||||||
{
|
{
|
||||||
double maxHeight = 0;
|
double maxHeight = 0;
|
||||||
double width = 0;
|
double width = 0;
|
||||||
|
|
||||||
|
// TODO UNO
|
||||||
|
var childSize = new Size(double.PositiveInfinity, double.PositiveInfinity);
|
||||||
foreach (UIElement child in Children)
|
foreach (UIElement child in Children)
|
||||||
{
|
{
|
||||||
child.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
|
child.Measure(childSize);
|
||||||
maxHeight = Math.Max(maxHeight, child.DesiredSize.Height);
|
maxHeight = Math.Max(maxHeight, child.DesiredSize.Height);
|
||||||
width += child.DesiredSize.Width;
|
width += child.DesiredSize.Width;
|
||||||
|
|
||||||
|
// TODO UNO
|
||||||
|
if (width > availableSize.Width)
|
||||||
|
{
|
||||||
|
childSize = new Size(0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new Size(Math.Min(width, availableSize.Width), Math.Min(availableSize.Height, maxHeight));
|
return new Size(Math.Min(width, availableSize.Width), Math.Min(availableSize.Height, maxHeight));
|
||||||
}
|
}
|
||||||
|
@ -64,7 +73,7 @@ namespace CalculatorApp.Controls
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Not display the item
|
// Not display the item
|
||||||
item.Arrange(new Rect(0, 0, 0, 0));
|
item.Arrange(new Rect(50000 /* TODO UNO */, 0, 0, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return finalSize;
|
return finalSize;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue