Use the same layout than the existing one while fixing the issue

This commit is contained in:
Rudy Huyn 2019-03-13 14:52:05 -07:00
commit 0f1d6c29cf
3 changed files with 20 additions and 7 deletions

View file

@ -347,6 +347,7 @@
<Setter Target="RowUnit1.Height" Value="2*"/>
<Setter Target="RowDisplay2.Height" Value="4*"/>
<Setter Target="RowUnit2.Height" Value="2*"/>
<Setter Target="RowDltrUnits.Height" Value="2*"/>
<Setter Target="CurrencyLoadingGrid.(Grid.ColumnSpan)" Value="2"/>
<Setter Target="ConverterNumPad.(Grid.Row)" Value="1"/>
<Setter Target="ConverterNumPad.(Grid.RowSpan)" Value="5"/>
@ -585,12 +586,16 @@
TabIndex="4"
Visibility="{x:Bind Model.IsCurrencyLoadingVisible, Mode=OneWay, Converter={StaticResource BooleanToVisibilityNegationConverter}}"/>
<Grid x:Name="SupplementaryResultsPanelInGrid"
Grid.Row="5"
Grid.Column="1"
Margin="12,0,12,0"
FlowDirection="{x:Bind LayoutDirection}"
Visibility="{x:Bind Model.IsCurrencyLoadingVisible, Mode=OneWay, Converter={StaticResource BooleanToVisibilityNegationConverter}}">
<StackPanel x:Name="SupplementaryResultsPanelInGrid"
Grid.Row="5"
Grid.Column="1"
MinHeight="48"
Margin="12,0,6,0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
FlowDirection="{x:Bind LayoutDirection}"
SizeChanged="SupplementaryResultsPanelInGrid_SizeChanged"
Visibility="{x:Bind Model.IsCurrencyLoadingVisible, Mode=OneWay, Converter={StaticResource BooleanToVisibilityNegationConverter}}">
<local:SupplementaryResults x:Name="SupplementaryResults"
HorizontalAlignment="Left"
VerticalAlignment="Center"
@ -643,7 +648,7 @@
</TextBlock>
</ContentControl>
</StackPanel>
</Grid>
</StackPanel>
<Grid x:Name="ConverterNumPad"
Grid.Row="6"

View file

@ -385,3 +385,10 @@ void UnitConverter::HideProgressRing()
CurrencyLoadingProgressRing->IsActive = false;
}
void CalculatorApp::UnitConverter::SupplementaryResultsPanelInGrid_SizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e)
{
//We add 0.01 to be sure to not create an infinite loop with SizeChanged events cascading due to float approximation
RowDltrUnits->MinHeight = max(48, e->NewSize.Height + 0.01);
}

View file

@ -88,5 +88,6 @@ namespace CalculatorApp
Windows::UI::Xaml::DispatcherTimer^ m_delayTimer;
bool m_isAnimationEnabled;
void SupplementaryResultsPanelInGrid_SizeChanged(Platform::Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
};
}