take feedback into account

This commit is contained in:
Rudy Huyn 2019-03-19 23:53:07 -07:00
commit 717039a4bc
4 changed files with 5 additions and 9 deletions

View file

@ -33,10 +33,12 @@ bool HorizontalNoOverflowStackPanel::ShouldPrioritizeLastItem()
Size HorizontalNoOverflowStackPanel::ArrangeOverride(Size finalSize)
{
float posX = 0;
if (Children->Size == 0)
{
return finalSize;
}
float posX = 0;
auto lastChild = Children->GetAt(Children->Size - 1);
float lastChildWidth = 0;
if (Children->Size > 2 && ShouldPrioritizeLastItem())

View file

@ -64,8 +64,7 @@ Windows::UI::Xaml::DataTemplate^ SupplementaryResultDataTemplateSelector::Select
}
}
SupplementaryResults::SupplementaryResults() :
m_data(ref new Vector<SupplementaryResult^>)
SupplementaryResults::SupplementaryResults()
{
InitializeComponent();
}

View file

@ -72,10 +72,5 @@ namespace CalculatorApp
SupplementaryResults();
DEPENDENCY_PROPERTY_OWNER(SupplementaryResults);
DEPENDENCY_PROPERTY_WITH_DEFAULT(Windows::Foundation::Collections::IIterable<ViewModel::SupplementaryResult^>^, Results, nullptr);
private:
void RefreshData();
void OnLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void OnConverterPropertyChanged(Platform::Object^ sender, Windows::UI::Xaml::Data::PropertyChangedEventArgs^ e);
Windows::Foundation::Collections::IObservableVector<ViewModel::SupplementaryResult^>^ m_data;
};
}

View file

@ -386,7 +386,7 @@ void UnitConverter::HideProgressRing()
CurrencyLoadingProgressRing->IsActive = false;
}
// The function will make sure the UI will have enough space to display supplementary results and currency information
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