Improve performance of SupplementaryResult + Modify the height of RowDltrUnits when UnitConverter is in Landscape (#249)

* Modify the height of RowDltrUnits when UnitConverter  is in LandscapeLayout mode

* clean

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

* Refactor SupplementaryItemsControl to improve performance, not rely on parents and not force the parent element to be HorizonAlignment="stretch"

* take feedback into account

* add HorizontalNoOverflowStackPanel to vcproj.filters

* format conditionals

* replace max by std::max
This commit is contained in:
Rudy Huyn
2019-03-26 11:24:36 -07:00
committed by Pepe Rivera
parent e9aea9237d
commit ef3f5e9cbb
11 changed files with 151 additions and 82 deletions

View File

@@ -12,6 +12,7 @@
#include "Controls/SupplementaryItemsControl.h"
#include "Controls/OperandTextBox.h"
#include "Controls/OperatorTextBox.h"
#include "Controls/HorizontalNoOverflowStackPanel.h"
#include "CalcViewModel/UnitConverterViewModel.h"
namespace CalculatorApp
@@ -58,18 +59,18 @@ namespace CalculatorApp
Windows::UI::Xaml::DataTemplate^ m_delighterTemplate;
};
public ref class SupplementaryResultNoOverflowStackPanel sealed: public CalculatorApp::Controls::HorizontalNoOverflowStackPanel
{
protected:
virtual bool ShouldPrioritizeLastItem() override;
};
[Windows::Foundation::Metadata::WebHostHidden]
public ref class SupplementaryResults sealed
{
public:
SupplementaryResults();
private:
void RefreshData();
void OnLoaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void OnConverterPropertyChanged(Platform::Object^ sender, Windows::UI::Xaml::Data::PropertyChangedEventArgs^ e);
void OnSupplementaryValuesLayoutUpdated(Platform::Object^ sender, Platform::Object^ e);
void OnWindowSizeChanged(Platform::Object^ sender, Windows::UI::Core::WindowSizeChangedEventArgs^ e);
Windows::Foundation::Collections::IObservableVector<ViewModel::SupplementaryResult^>^ m_data;
DEPENDENCY_PROPERTY_OWNER(SupplementaryResults);
DEPENDENCY_PROPERTY_WITH_DEFAULT(Windows::Foundation::Collections::IIterable<ViewModel::SupplementaryResult^>^, Results, nullptr);
};
}