* 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
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#include "pch.h"
|
|
#include "SupplementaryItemsControl.h"
|
|
#include "CalcViewModel/UnitConverterViewModel.h"
|
|
|
|
using namespace CalculatorApp;
|
|
using namespace CalculatorApp::Controls;
|
|
using namespace CalculatorApp::ViewModel;
|
|
using namespace Windows::System;
|
|
using namespace Windows::UI::Xaml;
|
|
using namespace Windows::UI::Xaml::Input;
|
|
using namespace Windows::UI::Xaml::Data;
|
|
using namespace Windows::UI::Xaml::Automation;
|
|
using namespace Windows::UI::Xaml::Automation::Peers;
|
|
using namespace Platform;
|
|
using namespace Windows::Foundation::Collections;
|
|
using namespace std;
|
|
|
|
DependencyObject^ SupplementaryItemsControl::GetContainerForItemOverride()
|
|
{
|
|
return ref new SupplementaryContentPresenter();
|
|
}
|
|
|
|
void SupplementaryItemsControl::PrepareContainerForItemOverride(DependencyObject^ element, Object^ item)
|
|
{
|
|
ItemsControl::PrepareContainerForItemOverride(element, item);
|
|
|
|
auto supplementaryResult = dynamic_cast<SupplementaryResult^>(item);
|
|
if (supplementaryResult)
|
|
{
|
|
AutomationProperties::SetName(element, supplementaryResult->GetLocalizedAutomationName());
|
|
}
|
|
}
|
|
|
|
AutomationPeer^ SupplementaryContentPresenter::OnCreateAutomationPeer()
|
|
{
|
|
return ref new SupplementaryContentPresenterAP(this);
|
|
}
|