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:
		| @@ -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); | ||||
|     }; | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user