Merge master into feature/GraphingCalculator branch (#585)

* Merge master into feature/GraphingCalculator branch
This commit is contained in:
Stephanie Anderl
2019-07-15 11:17:21 -07:00
committed by GitHub
parent 1475b49120
commit a418777f02
447 changed files with 18056 additions and 19323 deletions

View File

@@ -37,15 +37,15 @@ AboutFlyout::AboutFlyout()
Header->Text = resourceLoader.GetResourceString("AboutButton/Content");
auto copyrightText = LocalizationStringUtil::GetLocalizedString(resourceLoader.GetResourceString("AboutControlCopyright")->Data(), to_wstring(BUILD_YEAR).c_str());
auto copyrightText =
LocalizationStringUtil::GetLocalizedString(resourceLoader.GetResourceString("AboutControlCopyright")->Data(), to_wstring(BUILD_YEAR).c_str());
AboutControlCopyrightRun->Text = ref new String(copyrightText.c_str());
}
void AboutFlyout::FeedbackButton_Click(_In_ Object^ sender, _In_ RoutedEventArgs^ e)
void AboutFlyout::FeedbackButton_Click(_In_ Object ^ sender, _In_ RoutedEventArgs ^ e)
{
PackageVersion version = Package::Current->Id->Version;
String^ versionNumber = ref new String(L"Version ");
String ^ versionNumber = ref new String(L"Version ");
versionNumber = versionNumber + version.Major + "." + version.Minor + "." + version.Build + "." + version.Revision;
Launcher::LaunchUriAsync(ref new Uri("windows-feedback:?contextid=130&metadata=%7B%22Metadata%22:[%7B%22AppBuild%22:%22" + versionNumber + "%22%7D]%7D"));
}
@@ -53,7 +53,7 @@ void AboutFlyout::FeedbackButton_Click(_In_ Object^ sender, _In_ RoutedEventArgs
void AboutFlyout::SetVersionString()
{
PackageVersion version = Package::Current->Id->Version;
String^ appName = AppResourceProvider::GetInstance().GetResourceString(L"AppName");
String ^ appName = AppResourceProvider::GetInstance().GetResourceString(L"AppName");
AboutFlyoutVersion->Text = appName + L" " + version.Major + L"." + version.Minor + L"." + version.Build + L"." + version.Revision;
}
@@ -62,7 +62,7 @@ void AboutFlyout::SetDefaultFocus()
AboutFlyoutEULA->Focus(::FocusState::Programmatic);
}
void CalculatorApp::AboutFlyout::UserControl_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
void CalculatorApp::AboutFlyout::UserControl_Loaded(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e)
{
TraceLogger::GetInstance().LogAboutFlyoutOpened();
}

View File

@@ -7,7 +7,8 @@
namespace CalculatorApp
{
public ref class AboutFlyout sealed
public
ref class AboutFlyout sealed
{
public:
AboutFlyout();
@@ -15,8 +16,8 @@ namespace CalculatorApp
void SetDefaultFocus();
private:
void FeedbackButton_Click(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs^ e);
void FeedbackButton_Click(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void SetVersionString();
void UserControl_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void UserControl_Loaded(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
};
} /* namespace CalculatorApp */

View File

@@ -19,7 +19,6 @@
<Color x:Key="ChromeMediumLowColor">#FF2B2B2B</Color>
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{StaticResource AltHighColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource ChromeMediumLowColor}"/>
<SolidColorBrush x:Key="TitleBarBackgroundTransparentBrush" Color="Transparent"/>
<SolidColorBrush x:Key="TitleBarForegroundBaseHighBrush" Color="{StaticResource SystemBaseHighColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundTransparentBrush" Color="Transparent"/>
<SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="Transparent"/>
@@ -57,7 +56,6 @@
<Color x:Key="ChromeMediumLowColor">#FFE0E0E0</Color>
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{StaticResource SystemAltHighColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{StaticResource ChromeMediumLowColor}"/>
<SolidColorBrush x:Key="TitleBarBackgroundTransparentBrush" Color="Transparent"/>
<SolidColorBrush x:Key="TitleBarForegroundBaseHighBrush" Color="{StaticResource SystemBaseHighColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundTransparentBrush" Color="Transparent"/>
<SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="Transparent"/>
@@ -93,7 +91,6 @@
<x:Double x:Key="HighContrastStrokeThickness">2</x:Double>
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
<SolidColorBrush x:Key="TitleBarBackgroundTransparentBrush" Color="{ThemeResource SystemColorActiveCaptionColor}"/>
<SolidColorBrush x:Key="TitleBarForegroundBaseHighBrush" Color="{ThemeResource SystemColorCaptionTextColor}"/>
<SolidColorBrush x:Key="SystemControlBackgroundTransparentBrush" Color="{ThemeResource SystemColorButtonFaceColor}"/>
<SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="{ThemeResource SystemColorHighlightColor}"/>
@@ -374,7 +371,7 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Controls:CalculationResult">
<Grid x:Name="border" Background="{TemplateBinding Background}">
<Grid x:Name="Border" Background="{TemplateBinding Background}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="12"/>
<ColumnDefinition/>
@@ -384,19 +381,19 @@
<VisualStateGroup x:Name="ActiveStates">
<VisualState x:Name="Active">
<VisualState.Setters>
<Setter Target="normalOutput.FontWeight" Value="SemiBold"/>
<Setter Target="normalOutput.IsTextSelectionEnabled" Value="True"/>
<Setter Target="NormalOutput.FontWeight" Value="SemiBold"/>
<Setter Target="NormalOutput.IsTextSelectionEnabled" Value="True"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Normal"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ScrollViewer x:Name="textContainer"
<ScrollViewer x:Name="TextContainer"
Grid.Column="1"
Padding="0,0,0,0"
Style="{ThemeResource ResultsScrollerSnapped}"
AutomationProperties.AccessibilityView="Raw">
<TextBlock x:Name="normalOutput"
<TextBlock x:Name="NormalOutput"
Margin="{TemplateBinding DisplayMargin}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
@@ -408,7 +405,8 @@
TextAlignment="{TemplateBinding HorizontalContentAlignment}"
TextWrapping="NoWrap"/>
</ScrollViewer>
<HyperlinkButton x:Name="scrollLeft"
<HyperlinkButton x:Name="ScrollLeft"
x:Uid="CalculationResultScrollLeft"
Grid.Column="0"
Width="20"
MinWidth="20"
@@ -420,13 +418,15 @@
VerticalContentAlignment="Center"
Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
BorderThickness="0"
AutomationProperties.AutomationId="CalculationResultScrollLeft"
Visibility="Collapsed">
<FontIcon x:Name="scrollLeftText"
<FontIcon x:Name="ScrollLeftText"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Glyph="&#xE26C;"/>
</HyperlinkButton>
<HyperlinkButton x:Name="scrollRight"
<HyperlinkButton x:Name="ScrollRight"
x:Uid="CalculationResultScrollRight"
Grid.Column="2"
Width="20"
MinWidth="20"
@@ -438,8 +438,9 @@
VerticalContentAlignment="Center"
Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
BorderThickness="0"
AutomationProperties.AutomationId="CalculationResultScrollRight"
Visibility="Collapsed">
<FontIcon x:Name="scrollRightText"
<FontIcon x:Name="ScrollRightText"
FontFamily="{ThemeResource SymbolThemeFontFamily}"
FontSize="12"
Glyph="&#xE26B;"/>

View File

@@ -73,11 +73,10 @@ App::App()
#if _DEBUG
this->DebugSettings->IsBindingTracingEnabled = true;
this->DebugSettings->BindingFailed += ref new BindingFailedEventHandler([](_In_ Object^ /*sender*/, _In_ BindingFailedEventArgs^ e)
{
this->DebugSettings->BindingFailed += ref new BindingFailedEventHandler([](_In_ Object ^ /*sender*/, _In_ BindingFailedEventArgs ^ e) {
if (IsDebuggerPresent())
{
::Platform::String^ errorMessage = e->Message;
::Platform::String ^ errorMessage = e->Message;
__debugbreak();
}
});
@@ -87,7 +86,7 @@ App::App()
bool App::m_isAnimationEnabled = true;
/// <summary>
/// Return True if animation is enabled by user setting.
/// Return True if animation is enabled by user setting.
/// </summary>
bool App::IsAnimationEnabled()
{
@@ -96,12 +95,12 @@ bool App::IsAnimationEnabled()
/// <summary>
/// Return the current application view state. The value
/// will match one of the constants in the ViewState namespace.
/// will match one of the constants in the ViewState namespace.
/// </summary>
String^ App::GetAppViewState()
String ^ App::GetAppViewState()
{
String^ newViewState;
CoreWindow^ window = CoreWindow::GetForCurrentThread();
String ^ newViewState;
CoreWindow ^ window = CoreWindow::GetForCurrentThread();
if ((window->Bounds.Width >= 560) && (window->Bounds.Height >= 356))
{
newViewState = ViewState::DockedView;
@@ -114,14 +113,14 @@ String^ App::GetAppViewState()
return newViewState;
}
void App::AddWindowToMap(_In_ WindowFrameService^ frameService)
void App::AddWindowToMap(_In_ WindowFrameService ^ frameService)
{
reader_writer_lock::scoped_lock lock(m_windowsMapLock);
m_secondaryWindows[frameService->GetViewId()] = frameService;
TraceLogger::GetInstance().UpdateWindowCount(m_secondaryWindows.size());
}
WindowFrameService^ App::GetWindowFromMap(int viewId)
WindowFrameService ^ App::GetWindowFromMap(int viewId)
{
reader_writer_lock::scoped_lock_read lock(m_windowsMapLock);
auto windowMapEntry = m_secondaryWindows.find(viewId);
@@ -140,32 +139,33 @@ void App::RemoveWindowFromMap(int viewId)
m_secondaryWindows.erase(viewId);
}
void App::RemoveWindow(_In_ WindowFrameService^ frameService)
void App::RemoveWindow(_In_ WindowFrameService ^ frameService)
{
// Shell does not allow killing the main window.
// Shell does not allow killing the main window.
if (m_mainViewId != frameService->GetViewId())
{
HandleViewReleaseAndRemoveWindowFromMap(frameService);
}
}
task<void> App::HandleViewReleaseAndRemoveWindowFromMap(_In_ WindowFrameService^ frameService)
task<void> App::HandleViewReleaseAndRemoveWindowFromMap(_In_ WindowFrameService ^ frameService)
{
WeakReference weak(this);
// Unregister the event handler of the Main Page
auto frame = safe_cast<Frame^>(Window::Current->Content);
auto mainPage = safe_cast<MainPage^>(frame->Content);
auto frame = safe_cast<Frame ^>(Window::Current->Content);
auto mainPage = safe_cast<MainPage ^>(frame->Content);
mainPage->UnregisterEventHandlers();
return frameService->HandleViewRelease()
.then([weak, frameService]()
{
auto that = weak.Resolve<App>();
that->RemoveWindowFromMap(frameService->GetViewId());
}, task_continuation_context::use_arbitrary());
return frameService->HandleViewRelease().then(
[weak, frameService]() {
auto that = weak.Resolve<App>();
that->RemoveWindowFromMap(frameService->GetViewId());
},
task_continuation_context::use_arbitrary());
}
#pragma optimize("", off) // Turn off optimizations to work around coroutine optimization bug
task<void> App::SetupJumpList()
{
try
@@ -176,12 +176,11 @@ task<void> App::SetupJumpList()
jumpList->SystemGroupKind = JumpListSystemGroupKind::None;
jumpList->Items->Clear();
for (NavCategory^ option : calculatorOptions->Categories)
for (NavCategory ^ option : calculatorOptions->Categories)
{
ViewMode mode = option->Mode;
auto item = JumpListItem::CreateWithArguments(((int)mode).ToString(), L"ms-resource:///Resources/"+ NavCategory::GetNameResourceKey(mode));
auto item = JumpListItem::CreateWithArguments(((int)mode).ToString(), L"ms-resource:///Resources/" + NavCategory::GetNameResourceKey(mode));
item->Description = L"ms-resource:///Resources/" + NavCategory::GetNameResourceKey(mode);
item->GroupName = L"ms-resource:///Resources/" + NavCategoryGroup::GetHeaderResourceKey(calculatorOptions->GroupType);
item->Logo = ref new Uri("ms-appx:///Assets/" + mode.ToString() + ".png");
jumpList->Items->Append(item);
@@ -189,10 +188,13 @@ task<void> App::SetupJumpList()
co_await jumpList->SaveAsync();
}
catch(...) {}
}
catch (...)
{
}
};
#pragma optimize("", on)
void App::RemoveSecondaryWindow(_In_ WindowFrameService^ frameService)
void App::RemoveSecondaryWindow(_In_ WindowFrameService ^ frameService)
{
// Shell does not allow killing the main window.
if (m_mainViewId != frameService->GetViewId())
@@ -201,7 +203,7 @@ void App::RemoveSecondaryWindow(_In_ WindowFrameService^ frameService)
}
}
Frame^ App::CreateFrame()
Frame ^ App::CreateFrame()
{
auto frame = ref new Frame();
frame->FlowDirection = LocalizationService::GetInstance()->GetFlowDirection();
@@ -215,7 +217,7 @@ Frame^ App::CreateFrame()
/// search results, and so forth.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
void App::OnLaunched(LaunchActivatedEventArgs^ args)
void App::OnLaunched(LaunchActivatedEventArgs ^ args)
{
TraceLogger::GetInstance().LogWindowLaunched();
if (args->PrelaunchActivated)
@@ -227,32 +229,34 @@ void App::OnLaunched(LaunchActivatedEventArgs^ args)
OnAppLaunch(args, args->Arguments);
}
void App::OnAppLaunch(IActivatedEventArgs^ args, String^ argument)
void App::OnAppLaunch(IActivatedEventArgs ^ args, String ^ argument)
{
auto previousExecutionState = args->PreviousExecutionState;
TraceLogger::GetInstance().LogOnAppLaunch(previousExecutionState.ToString()->Data());
#if _DEBUG
if (IsDebuggerPresent())
{
DebugSettings->EnableFrameRateCounter = true;
}
#endif
// Uncomment the following lines to display frame-rate and per-frame CPU usage info.
//#if _DEBUG
// if (IsDebuggerPresent())
// {
// DebugSettings->EnableFrameRateCounter = true;
// }
//#endif
auto userSettings = ref new Windows::UI::ViewManagement::UISettings();
m_isAnimationEnabled = userSettings->AnimationsEnabled;
args->SplashScreen->Dismissed += ref new TypedEventHandler<SplashScreen^, Object^>(this, &App::DismissedEventHandler);
args->SplashScreen->Dismissed += ref new TypedEventHandler<SplashScreen ^, Object ^>(this, &App::DismissedEventHandler);
auto rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
auto rootFrame = dynamic_cast<Frame ^>(Window::Current->Content);
WeakReference weak(this);
float minWindowWidth = static_cast<float>(static_cast<double>(this->Resources->Lookup(ApplicationResourceKeys::AppMinWindowWidth)));
float minWindowHeight = static_cast<float>(static_cast<double>(this->Resources->Lookup(ApplicationResourceKeys::AppMinWindowHeight)));
Size minWindowSize = SizeHelper::FromDimensions(minWindowWidth, minWindowHeight);
ApplicationView^ appView = ApplicationView::GetForCurrentView();
ApplicationDataContainer^ localSettings = ApplicationData::Current->LocalSettings;
ApplicationView ^ appView = ApplicationView::GetForCurrentView();
ApplicationDataContainer ^ localSettings = ApplicationData::Current->LocalSettings;
// For very first launch, set the size of the calc as size of the default standard mode
if (!localSettings->Values->HasKey(L"VeryFirstLaunch"))
{
@@ -269,17 +273,17 @@ void App::OnAppLaunch(IActivatedEventArgs^ args, String^ argument)
// just ensure that the window is active
if (rootFrame == nullptr)
{
if (!Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) // PC Family
if (!Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) // PC Family
{
// Disable the system view activation policy during the first launch of the app
// Disable the system view activation policy during the first launch of the app
// only for PC family devices and not for phone family devices
try
{
ApplicationViewSwitcher::DisableSystemViewActivationPolicy();
}
catch (Exception^ e)
catch (Exception ^ e)
{
// Log that DisableSystemViewActionPolicy didn't work
// Log that DisableSystemViewActionPolicy didn't work
}
}
@@ -306,76 +310,77 @@ void App::OnAppLaunch(IActivatedEventArgs^ args, String^ argument)
TraceLogger::GetInstance().LogAppLaunchStart();
// !Phone check is required because even in continuum mode user interaction mode is Mouse not Touch
if ((UIViewSettings::GetForCurrentView()->UserInteractionMode == UserInteractionMode::Mouse) && (!Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")))
if ((UIViewSettings::GetForCurrentView()->UserInteractionMode == UserInteractionMode::Mouse)
&& (!Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")))
{
// If the pre-launch hasn't happened then allow for the new window/view creation
if (!m_preLaunched)
{
auto newCoreAppView = CoreApplication::CreateNewView();
newCoreAppView->Dispatcher->RunAsync(CoreDispatcherPriority::Normal, ref new DispatchedHandler([args, argument, minWindowSize, weak]()
{
TraceLogger::GetInstance().LogNewWindowCreationBegin(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()));
auto that = weak.Resolve<App>();
if (that != nullptr)
{
auto rootFrame = App::CreateFrame();
SetMinWindowSizeAndActivate(rootFrame, minWindowSize);
if (!rootFrame->Navigate(MainPage::typeid, argument))
newCoreAppView->Dispatcher->RunAsync(
CoreDispatcherPriority::Normal, ref new DispatchedHandler([args, argument, minWindowSize, weak]() {
TraceLogger::GetInstance().LogNewWindowCreationBegin(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()));
auto that = weak.Resolve<App>();
if (that != nullptr)
{
// We couldn't navigate to the main page, kill the app so we have a good
// stack to debug
throw std::bad_exception();
}
auto rootFrame = App::CreateFrame();
SetMinWindowSizeAndActivate(rootFrame, minWindowSize);
auto frameService = WindowFrameService::CreateNewWindowFrameService(rootFrame, true, weak);
that->AddWindowToMap(frameService);
auto dispatcher = CoreWindow::GetForCurrentThread()->Dispatcher;
auto safeFrameServiceCreation = std::make_shared<SafeFrameWindowCreation>(frameService, that);
int newWindowId = ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread());
ActivationViewSwitcher^ activationViewSwitcher;
auto activateEventArgs = dynamic_cast<IViewSwitcherProvider^>(args);
if (activateEventArgs != nullptr)
{
activationViewSwitcher = activateEventArgs->ViewSwitcher;
}
if (activationViewSwitcher != nullptr)
{
activationViewSwitcher->ShowAsStandaloneAsync(newWindowId, ViewSizePreference::Default);
safeFrameServiceCreation->SetOperationSuccess(true);
}
else
{
auto activatedEventArgs = dynamic_cast<IApplicationViewActivatedEventArgs^>(args);
if ((activatedEventArgs != nullptr) && (activatedEventArgs->CurrentlyShownApplicationViewId != 0))
if (!rootFrame->Navigate(MainPage::typeid, argument))
{
create_task(ApplicationViewSwitcher::TryShowAsStandaloneAsync(
frameService->GetViewId(),
ViewSizePreference::Default,
activatedEventArgs->CurrentlyShownApplicationViewId,
ViewSizePreference::Default
))
.then([safeFrameServiceCreation](bool viewShown)
// We couldn't navigate to the main page, kill the app so we have a good
// stack to debug
throw std::bad_exception();
}
auto frameService = WindowFrameService::CreateNewWindowFrameService(rootFrame, true, weak);
that->AddWindowToMap(frameService);
auto dispatcher = CoreWindow::GetForCurrentThread()->Dispatcher;
auto safeFrameServiceCreation = std::make_shared<SafeFrameWindowCreation>(frameService, that);
int newWindowId = ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread());
ActivationViewSwitcher ^ activationViewSwitcher;
auto activateEventArgs = dynamic_cast<IViewSwitcherProvider ^>(args);
if (activateEventArgs != nullptr)
{
activationViewSwitcher = activateEventArgs->ViewSwitcher;
}
if (activationViewSwitcher != nullptr)
{
activationViewSwitcher->ShowAsStandaloneAsync(newWindowId, ViewSizePreference::Default);
safeFrameServiceCreation->SetOperationSuccess(true);
}
else
{
auto activatedEventArgs = dynamic_cast<IApplicationViewActivatedEventArgs ^>(args);
if ((activatedEventArgs != nullptr) && (activatedEventArgs->CurrentlyShownApplicationViewId != 0))
{
// SafeFrameServiceCreation is used to automatically remove the frame
// from the list of frames if something goes bad.
safeFrameServiceCreation->SetOperationSuccess(viewShown);
}, task_continuation_context::use_current());
create_task(ApplicationViewSwitcher::TryShowAsStandaloneAsync(
frameService->GetViewId(),
ViewSizePreference::Default,
activatedEventArgs->CurrentlyShownApplicationViewId,
ViewSizePreference::Default))
.then(
[safeFrameServiceCreation](bool viewShown) {
// SafeFrameServiceCreation is used to automatically remove the frame
// from the list of frames if something goes bad.
safeFrameServiceCreation->SetOperationSuccess(viewShown);
},
task_continuation_context::use_current());
}
}
}
}
TraceLogger::GetInstance().LogNewWindowCreationEnd(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()));
}));
TraceLogger::GetInstance().LogNewWindowCreationEnd(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()));
}));
}
else
{
TraceLogger::GetInstance().LogNewWindowCreationBegin(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()));
ActivationViewSwitcher^ activationViewSwitcher;
auto activateEventArgs = dynamic_cast<IViewSwitcherProvider^>(args);
ActivationViewSwitcher ^ activationViewSwitcher;
auto activateEventArgs = dynamic_cast<IViewSwitcherProvider ^>(args);
if (activateEventArgs != nullptr)
{
activationViewSwitcher = activateEventArgs->ViewSwitcher;
@@ -383,7 +388,8 @@ void App::OnAppLaunch(IActivatedEventArgs^ args, String^ argument)
if (activationViewSwitcher != nullptr)
{
activationViewSwitcher->ShowAsStandaloneAsync(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()), ViewSizePreference::Default);
activationViewSwitcher->ShowAsStandaloneAsync(
ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()), ViewSizePreference::Default);
TraceLogger::GetInstance().LogNewWindowCreationEnd(ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()));
TraceLogger::GetInstance().LogPrelaunchedAppActivatedByUser();
}
@@ -404,23 +410,24 @@ void App::OnAppLaunch(IActivatedEventArgs^ args, String^ argument)
// parameter
if (!rootFrame->Navigate(MainPage::typeid, argument))
{
// We couldn't navigate to the main page,
// We couldn't navigate to the main page,
// kill the app so we have a good stack to debug
throw std::bad_exception();
}
}
if (!Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
// for tablet mode: since system view activation policy is disabled so do ShowAsStandaloneAsync if activationViewSwitcher exists in activationArgs
ActivationViewSwitcher^ activationViewSwitcher;
auto activateEventArgs = dynamic_cast<IViewSwitcherProvider^>(args);
// for tablet mode: since system view activation policy is disabled so do ShowAsStandaloneAsync if activationViewSwitcher exists in
// activationArgs
ActivationViewSwitcher ^ activationViewSwitcher;
auto activateEventArgs = dynamic_cast<IViewSwitcherProvider ^>(args);
if (activateEventArgs != nullptr)
{
activationViewSwitcher = activateEventArgs->ViewSwitcher;
}
if (activationViewSwitcher != nullptr)
{
auto viewId = safe_cast<IApplicationViewActivatedEventArgs^>(args)->CurrentlyShownApplicationViewId;
auto viewId = safe_cast<IApplicationViewActivatedEventArgs ^>(args)->CurrentlyShownApplicationViewId;
if (viewId != 0)
{
activationViewSwitcher->ShowAsStandaloneAsync(viewId);
@@ -433,10 +440,10 @@ void App::OnAppLaunch(IActivatedEventArgs^ args, String^ argument)
}
}
void App::SetMinWindowSizeAndActivate(Frame^ rootFrame, Size minWindowSize)
void App::SetMinWindowSizeAndActivate(Frame ^ rootFrame, Size minWindowSize)
{
// SetPreferredMinSize should always be called before Window::Activate
ApplicationView^ appView = ApplicationView::GetForCurrentView();
ApplicationView ^ appView = ApplicationView::GetForCurrentView();
appView->SetPreferredMinSize(minWindowSize);
// Place the frame in the current Window
@@ -449,7 +456,7 @@ void App::RegisterDependencyProperties()
NarratorNotifier::RegisterDependencyProperties();
}
void App::OnActivated(IActivatedEventArgs^ args)
void App::OnActivated(IActivatedEventArgs ^ args)
{
if (args->Kind == ActivationKind::Protocol)
{
@@ -460,14 +467,13 @@ void App::OnActivated(IActivatedEventArgs^ args)
}
}
void App::DismissedEventHandler(SplashScreen^ sender, Object^ e)
void App::DismissedEventHandler(SplashScreen ^ sender, Object ^ e)
{
SetupJumpList();
}
float App::GetAppWindowHeight()
{
CoreWindow^ window = CoreWindow::GetForCurrentThread();
CoreWindow ^ window = CoreWindow::GetForCurrentThread();
return window->Bounds.Height;
}

View File

@@ -26,28 +26,27 @@ namespace CalculatorApp
{
public:
App();
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs^ args) override;
virtual void OnActivated(Windows::ApplicationModel::Activation::IActivatedEventArgs^ args) override;
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs ^ args) override;
virtual void OnActivated(Windows::ApplicationModel::Activation::IActivatedEventArgs ^ args) override;
internal:
static bool IsAnimationEnabled();
static Platform::String^ GetAppViewState();
internal : static bool IsAnimationEnabled();
static Platform::String ^ GetAppViewState();
static float GetAppWindowHeight();
void RemoveWindow(_In_ WindowFrameService^ frameService);
void RemoveSecondaryWindow(_In_ WindowFrameService^ frameService);
void RemoveWindow(_In_ WindowFrameService ^ frameService);
void RemoveSecondaryWindow(_In_ WindowFrameService ^ frameService);
private:
static Windows::UI::Xaml::Controls::Frame^ CreateFrame();
static void SetMinWindowSizeAndActivate(Windows::UI::Xaml::Controls::Frame^ rootFrame, Windows::Foundation::Size minWindowSize);
static Windows::UI::Xaml::Controls::Frame ^ CreateFrame();
static void SetMinWindowSizeAndActivate(Windows::UI::Xaml::Controls::Frame ^ rootFrame, Windows::Foundation::Size minWindowSize);
void OnAppLaunch(Windows::ApplicationModel::Activation::IActivatedEventArgs^ args, Platform::String^ argument);
void DismissedEventHandler(Windows::ApplicationModel::Activation::SplashScreen^ sender, Platform::Object^ e);
void OnAppLaunch(Windows::ApplicationModel::Activation::IActivatedEventArgs ^ args, Platform::String ^ argument);
void DismissedEventHandler(Windows::ApplicationModel::Activation::SplashScreen ^ sender, Platform::Object ^ e);
void RegisterDependencyProperties();
class SafeFrameWindowCreation final
{
public:
SafeFrameWindowCreation(_In_ WindowFrameService^ frameService, App^ parent)
SafeFrameWindowCreation(_In_ WindowFrameService ^ frameService, App ^ parent)
: m_frameService(frameService)
, m_frameOpenedInWindow(false)
, m_parent(parent)
@@ -70,24 +69,24 @@ namespace CalculatorApp
}
private:
WindowFrameService^ m_frameService;
WindowFrameService ^ m_frameService;
bool m_frameOpenedInWindow;
App^ m_parent;
App ^ m_parent;
};
private:
concurrency::reader_writer_lock m_windowsMapLock;
std::unordered_map<int, WindowFrameService^> m_secondaryWindows;
std::unordered_map<int, WindowFrameService ^> m_secondaryWindows;
concurrency::task<void> SetupJumpList();
concurrency::task<void> HandleViewReleaseAndRemoveWindowFromMap(_In_ WindowFrameService^ frameService);
void AddWindowToMap(_In_ WindowFrameService^ frameService);
WindowFrameService^ GetWindowFromMap(int viewId);
concurrency::task<void> HandleViewReleaseAndRemoveWindowFromMap(_In_ WindowFrameService ^ frameService);
void AddWindowToMap(_In_ WindowFrameService ^ frameService);
WindowFrameService ^ GetWindowFromMap(int viewId);
void RemoveWindowFromMap(int viewId);
int m_mainViewId;
bool m_preLaunched;
Windows::UI::Xaml::Controls::Primitives::Popup^ m_aboutPopup;
Windows::UI::Xaml::Controls::Primitives::Popup ^ m_aboutPopup;
static bool m_isAnimationEnabled;
};

View File

@@ -8,8 +8,8 @@
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">10.0.17763.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.18362.0</WindowsTargetPlatformMinVersion>
<!-- We want to manually control the MinVersion/MaxVersionTested in the manifest so turn of the replacement. -->
<AppxOSMinVersionReplaceManifestVersion>false</AppxOSMinVersionReplaceManifestVersion>
<AppxOSMaxVersionTestedReplaceManifestVersion>false</AppxOSMaxVersionTestedReplaceManifestVersion>
@@ -62,46 +62,46 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@@ -135,7 +135,7 @@
</ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 </AdditionalOptions>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
@@ -144,7 +144,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 </AdditionalOptions>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
@@ -153,7 +153,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
@@ -165,7 +165,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
@@ -177,7 +177,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 </AdditionalOptions>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
@@ -186,7 +186,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
@@ -198,7 +198,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 </AdditionalOptions>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
@@ -207,7 +207,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
@@ -237,19 +237,15 @@
<ClInclude Include="Controls\OverflowTextBlockAutomationPeer.h" />
<ClInclude Include="Common\AlwaysSelectedCollectionView.h" />
<ClInclude Include="Common\BindableBase.h" />
<ClInclude Include="Controls\AppBar.h" />
<ClInclude Include="Controls\CalculationResult.h" />
<ClInclude Include="Controls\CalculatorButton.h" />
<ClInclude Include="Controls\FlipButtons.h" />
<ClInclude Include="Controls\OperandTextBox.h" />
<ClInclude Include="Controls\OperatorTextBox.h" />
<ClInclude Include="Controls\OverflowTextBlock.h" />
<ClInclude Include="Controls\RadixButton.h" />
<ClInclude Include="Controls\SupplementaryItemsControl.h" />
<ClInclude Include="Converters\BitFlipAutomationNameConverter.h" />
<ClInclude Include="Converters\BooleanNegationConverter.h" />
<ClInclude Include="Converters\BooleanToVisibilityConverter.h" />
<ClInclude Include="Converters\ExpressionItemContainerStyle.h" />
<ClInclude Include="Converters\ExpressionItemTemplateSelector.h" />
<ClInclude Include="Converters\ItemSizeToVisibilityConverter.h" />
<ClInclude Include="Converters\RadixToStringConverter.h" />
@@ -260,7 +256,6 @@
<ClInclude Include="App.xaml.h">
<DependentUpon>App.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Common\TitleBarHelper.h" />
<ClInclude Include="Views\Calculator.xaml.h">
<DependentUpon>Views\Calculator.xaml</DependentUpon>
</ClInclude>
@@ -384,15 +379,12 @@
<ClCompile Include="Controls\CalculationResult.cpp" />
<ClCompile Include="Controls\CalculatorButton.cpp" />
<ClCompile Include="Controls\FlipButtons.cpp" />
<ClCompile Include="Controls\OperandTextBox.cpp" />
<ClCompile Include="Controls\OperatorTextBox.cpp" />
<ClCompile Include="Controls\OverflowTextBlock.cpp" />
<ClCompile Include="Controls\RadixButton.cpp" />
<ClCompile Include="Controls\SupplementaryItemsControl.cpp" />
<ClCompile Include="Converters\BitFlipAutomationNameConverter.cpp" />
<ClCompile Include="Converters\BooleanNegationConverter.cpp" />
<ClCompile Include="Converters\BooleanToVisibilityConverter.cpp" />
<ClCompile Include="Converters\ExpressionItemContainerStyle.cpp" />
<ClCompile Include="Converters\ExpressionItemTemplateSelector.cpp" />
<ClCompile Include="Converters\ItemSizeToVisibilityConverter.cpp" />
<ClCompile Include="Converters\RadixToStringConverter.cpp" />
@@ -409,7 +401,6 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="Common\TitleBarHelper.cpp" />
<ClCompile Include="Views\Calculator.xaml.cpp">
<DependentUpon>Views\Calculator.xaml</DependentUpon>
</ClCompile>
@@ -870,7 +861,7 @@
</Target>
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\packages\Microsoft.WindowsCalculator.PGO.1.0.2\build\native\Microsoft.WindowsCalculator.PGO.targets" Condition="Exists('..\..\packages\Microsoft.WindowsCalculator.PGO.1.0.2\build\native\Microsoft.WindowsCalculator.PGO.targets')" />
<Import Project="..\..\packages\Microsoft.UI.Xaml.2.0.181018004\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\packages\Microsoft.UI.Xaml.2.0.181018004\build\native\Microsoft.UI.Xaml.targets')" />
<Import Project="..\..\packages\Microsoft.UI.Xaml.2.1.190405004.2\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\packages\Microsoft.UI.Xaml.2.1.190405004.2\build\native\Microsoft.UI.Xaml.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
@@ -878,6 +869,6 @@
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.WindowsCalculator.PGO.1.0.2\build\native\Microsoft.WindowsCalculator.PGO.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.WindowsCalculator.PGO.1.0.2\build\native\Microsoft.WindowsCalculator.PGO.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.WindowsCalculator.PGO.1.0.2\build\native\Microsoft.WindowsCalculator.PGO.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.WindowsCalculator.PGO.1.0.2\build\native\Microsoft.WindowsCalculator.PGO.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.UI.Xaml.2.0.181018004\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.UI.Xaml.2.0.181018004\build\native\Microsoft.UI.Xaml.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.UI.Xaml.2.1.190405004.2\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.UI.Xaml.2.1.190405004.2\build\native\Microsoft.UI.Xaml.targets'))" />
</Target>
</Project>

View File

@@ -246,9 +246,6 @@
<ClCompile Include="Converters\BooleanToVisibilityConverter.cpp">
<Filter>Converters</Filter>
</ClCompile>
<ClCompile Include="Converters\ExpressionItemContainerStyle.cpp">
<Filter>Converters</Filter>
</ClCompile>
<ClCompile Include="Converters\ExpressionItemTemplateSelector.cpp">
<Filter>Converters</Filter>
</ClCompile>
@@ -274,12 +271,6 @@
<ClCompile Include="Views\NumberPad.xaml.cpp" />
<ClCompile Include="Views\SupplementaryResults.xaml.cpp" />
<ClCompile Include="Views\UnitConverter.xaml.cpp" />
<ClCompile Include="Controls\OperandTextBox.cpp">
<Filter>Controls</Filter>
</ClCompile>
<ClCompile Include="Controls\OperatorTextBox.cpp">
<Filter>Controls</Filter>
</ClCompile>
<ClCompile Include="Controls\FlipButtons.cpp">
<Filter>Controls</Filter>
</ClCompile>
@@ -290,9 +281,6 @@
</ClCompile>
<ClCompile Include="WindowFrameService.cpp" />
<ClCompile Include="Views\DateCalculator.xaml.cpp" />
<ClCompile Include="Common\TitleBarHelper.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="Controls\CalculationResultAutomationPeer.cpp">
<Filter>Controls</Filter>
</ClCompile>
@@ -302,7 +290,6 @@
<ClCompile Include="Views\StateTriggers\AspectRatioTrigger.cpp">
<Filter>Views\StateTriggers</Filter>
</ClCompile>
<ClCompile Include="Views\TitleBar.xaml.cpp" />
<ClCompile Include="Views\MemoryListItem.xaml.cpp" />
<ClCompile Include="Views\OperatorsPanel.xaml.cpp" />
<ClCompile Include="Controls\SupplementaryItemsControl.cpp">
@@ -314,6 +301,7 @@
<ClCompile Include="Controls\HorizontalNoOverflowStackPanel.cpp">
<Filter>Controls</Filter>
</ClCompile>
<ClCompile Include="Views\TitleBar.xaml.cpp" />
<ClCompile Include="Views\GraphingCalculator\EquationInputArea.xaml.cpp" />
<ClCompile Include="Views\GraphingCalculator\GraphingCalculator.xaml.cpp" />
<ClCompile Include="Controls\EquationTextBox.cpp">
@@ -329,9 +317,6 @@
<ClInclude Include="Common\BindableBase.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Controls\AppBar.h">
<Filter>Controls</Filter>
</ClInclude>
<ClInclude Include="Controls\CalculationResult.h">
<Filter>Controls</Filter>
</ClInclude>
@@ -350,9 +335,6 @@
<ClInclude Include="Converters\BooleanToVisibilityConverter.h">
<Filter>Converters</Filter>
</ClInclude>
<ClInclude Include="Converters\ExpressionItemContainerStyle.h">
<Filter>Converters</Filter>
</ClInclude>
<ClInclude Include="Converters\ExpressionItemTemplateSelector.h">
<Filter>Converters</Filter>
</ClInclude>
@@ -378,12 +360,6 @@
<ClInclude Include="Views\NumberPad.xaml.h" />
<ClInclude Include="Views\SupplementaryResults.xaml.h" />
<ClInclude Include="Views\UnitConverter.xaml.h" />
<ClInclude Include="Controls\OperandTextBox.h">
<Filter>Controls</Filter>
</ClInclude>
<ClInclude Include="Controls\OperatorTextBox.h">
<Filter>Controls</Filter>
</ClInclude>
<ClInclude Include="Controls\FlipButtons.h">
<Filter>Controls</Filter>
</ClInclude>
@@ -397,9 +373,6 @@
<ClInclude Include="Converters\BitFlipAutomationNameConverter.h">
<Filter>Converters</Filter>
</ClInclude>
<ClInclude Include="Common\TitleBarHelper.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Controls\CalculationResultAutomationPeer.h">
<Filter>Controls</Filter>
</ClInclude>
@@ -409,7 +382,6 @@
<ClInclude Include="Views\StateTriggers\AspectRatioTrigger.h">
<Filter>Views\StateTriggers</Filter>
</ClInclude>
<ClInclude Include="Views\TitleBar.xaml.h" />
<ClInclude Include="Views\MemoryListItem.xaml.h" />
<ClInclude Include="Views\OperatorsPanel.xaml.h" />
<ClInclude Include="Controls\SupplementaryItemsControl.h">
@@ -421,6 +393,7 @@
<ClInclude Include="Controls\HorizontalNoOverflowStackPanel.h">
<Filter>Controls</Filter>
</ClInclude>
<ClInclude Include="Views\TitleBar.xaml.h" />
<ClInclude Include="Views\GraphingCalculator\EquationInputArea.xaml.h" />
<ClInclude Include="Views\GraphingCalculator\GraphingCalculator.xaml.h" />
<ClInclude Include="Controls\EquationTextBox.h">
@@ -484,21 +457,22 @@
<Page Include="Views\DateCalculator.xaml">
<Filter>Views</Filter>
</Page>
<Page Include="Views\TitleBar.xaml">
<Filter>Views</Filter>
</Page>
<Page Include="Views\MemoryListItem.xaml">
<Filter>Views</Filter>
</Page>
<Page Include="Views\OperatorsPanel.xaml">
<Filter>Views</Filter>
</Page>
<Page Include="Views\TitleBar.xaml">
<Filter>Views</Filter>
</Page>
<Page Include="Views\GraphingCalculator\EquationInputArea.xaml">
<Filter>Views\GraphingCalculator</Filter>
</Page>
<Page Include="Views\GraphingCalculator\GraphingCalculator.xaml">
<Filter>Views\GraphingCalculator</Filter>
</Page>
<Page Include="$(MSBuildThisFileDirectory)DensityStyles\Compact.xaml" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Resources\en-US\CEngineStrings.resw">
@@ -1592,4 +1566,8 @@
<ItemGroup>
<ResourceCompile Include="Calculator.rc" />
</ItemGroup>
<ItemGroup>
<CopyFileToFolders Include="$(GraphingImplDll)" />
<CopyFileToFolders Include="$(GraphingEngineDll)" />
</ItemGroup>
</Project>

View File

@@ -3,107 +3,104 @@
#pragma once
namespace CalculatorApp { namespace Common
namespace CalculatorApp
{
ref class AlwaysSelectedCollectionView sealed:
public Windows::UI::Xaml::DependencyObject,
public Windows::UI::Xaml::Data::ICollectionView
namespace Common
{
internal:
AlwaysSelectedCollectionView(Windows::UI::Xaml::Interop::IBindableVector^ source):
m_currentPosition(-1)
ref class AlwaysSelectedCollectionView sealed : public Windows::UI::Xaml::DependencyObject, public Windows::UI::Xaml::Data::ICollectionView
{
m_source = source;
internal : AlwaysSelectedCollectionView(Windows::UI::Xaml::Interop::IBindableVector ^ source)
: m_currentPosition(-1)
{
m_source = source;
Windows::UI::Xaml::Interop::IBindableObservableVector^ observable = dynamic_cast<Windows::UI::Xaml::Interop::IBindableObservableVector^>(source);
if (observable)
{
observable->VectorChanged +=
ref new Windows::UI::Xaml::Interop::BindableVectorChangedEventHandler(this, &AlwaysSelectedCollectionView::OnSourceBindableVectorChanged);
}
}
private:
// ICollectionView
// Not implemented methods
virtual Windows::Foundation::IAsyncOperation<Windows::UI::Xaml::Data::LoadMoreItemsResult>^ LoadMoreItemsAsync(unsigned int) = Windows::UI::Xaml::Data::ICollectionView::LoadMoreItemsAsync
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToFirst() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToFirst
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToLast() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToLast
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToNext() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToNext
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToPrevious() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToPrevious
{
throw ref new Platform::NotImplementedException();
}
property Windows::Foundation::Collections::IObservableVector<Platform::Object^>^ CollectionGroups
{
virtual Windows::Foundation::Collections::IObservableVector<Platform::Object^>^ get() = Windows::UI::Xaml::Data::ICollectionView::CollectionGroups::get
{
return ref new Platform::Collections::Vector<Platform::Object^>();
}
}
property bool HasMoreItems
{
virtual bool get() = Windows::UI::Xaml::Data::ICollectionView::HasMoreItems::get
{
return false;
}
}
// Implementented methods
virtual bool MoveCurrentTo(Platform::Object^ item) = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentTo
{
if (item)
{
unsigned int newCurrentPosition = 0;
bool result = m_source->IndexOf(item, &newCurrentPosition);
if (result)
Windows::UI::Xaml::Interop::IBindableObservableVector ^ observable =
dynamic_cast<Windows::UI::Xaml::Interop::IBindableObservableVector ^>(source);
if (observable)
{
m_currentPosition = newCurrentPosition;
m_currentChanged(this, nullptr);
return true;
observable->VectorChanged += ref new Windows::UI::Xaml::Interop::BindableVectorChangedEventHandler(
this, &AlwaysSelectedCollectionView::OnSourceBindableVectorChanged);
}
}
// The item is not in the collection
// We're going to schedule a call back later so we
// restore the selection to the way we wanted it to begin with
if (m_currentPosition >= 0 && m_currentPosition < static_cast<int>(m_source->Size))
private:
// ICollectionView
// Not implemented methods
virtual Windows::Foundation::IAsyncOperation<
Windows::UI::Xaml::Data::LoadMoreItemsResult> ^ LoadMoreItemsAsync(unsigned int) = Windows::UI::Xaml::Data::ICollectionView::LoadMoreItemsAsync
{
this->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal,
ref new Windows::UI::Core::DispatchedHandler(
[this]()
{
m_currentChanged(this, nullptr);
}));
throw ref new Platform::NotImplementedException();
}
return false;
}
virtual bool MoveCurrentToPosition(int index) = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToPosition
{
if (index < 0 || index >= static_cast<int>(m_source->Size))
virtual bool MoveCurrentToFirst() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToFirst
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToLast() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToLast
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToNext() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToNext
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToPrevious() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToPrevious
{
throw ref new Platform::NotImplementedException();
}
property Windows::Foundation::Collections::IObservableVector<Platform::Object ^> ^ CollectionGroups {
virtual Windows::Foundation::Collections::IObservableVector<
Platform::Object ^> ^ get() = Windows::UI::Xaml::Data::ICollectionView::CollectionGroups::get
{
return ref new Platform::Collections::Vector<Platform::Object ^>();
}
} property bool HasMoreItems
{
virtual bool get() = Windows::UI::Xaml::Data::ICollectionView::HasMoreItems::get
{
return false;
}
}
// Implementented methods
virtual bool MoveCurrentTo(Platform::Object ^ item) = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentTo
{
if (item)
{
unsigned int newCurrentPosition = 0;
bool result = m_source->IndexOf(item, &newCurrentPosition);
if (result)
{
m_currentPosition = newCurrentPosition;
m_currentChanged(this, nullptr);
return true;
}
}
// The item is not in the collection
// We're going to schedule a call back later so we
// restore the selection to the way we wanted it to begin with
if (m_currentPosition >= 0 && m_currentPosition < static_cast<int>(m_source->Size))
{
this->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]() {
m_currentChanged(this, nullptr);
}));
}
return false;
}
m_currentPosition = index;
m_currentChanged(this, nullptr);
return true;
}
virtual bool MoveCurrentToPosition(int index) = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToPosition
{
if (index < 0 || index >= static_cast<int>(m_source->Size))
{
return false;
}
property Platform::Object^ CurrentItem
m_currentPosition = index;
m_currentChanged(this, nullptr);
return true;
}
property Platform::Object^ CurrentItem
{
virtual Platform::Object^ get() = Windows::UI::Xaml::Data::ICollectionView::CurrentItem::get
{
@@ -116,30 +113,30 @@ namespace CalculatorApp { namespace Common
}
property int CurrentPosition
{
virtual int get() = Windows::UI::Xaml::Data::ICollectionView::CurrentPosition::get
{
return m_currentPosition;
virtual int get() = Windows::UI::Xaml::Data::ICollectionView::CurrentPosition::get
{
return m_currentPosition;
}
}
}
property bool IsCurrentAfterLast
{
virtual bool get() = Windows::UI::Xaml::Data::ICollectionView::IsCurrentAfterLast::get
property bool IsCurrentAfterLast
{
return m_currentPosition >= static_cast<int>(m_source->Size);
virtual bool get() = Windows::UI::Xaml::Data::ICollectionView::IsCurrentAfterLast::get
{
return m_currentPosition >= static_cast<int>(m_source->Size);
}
}
}
property bool IsCurrentBeforeFirst
{
virtual bool get() = Windows::UI::Xaml::Data::ICollectionView::IsCurrentBeforeFirst::get
property bool IsCurrentBeforeFirst
{
return m_currentPosition < 0;
virtual bool get() = Windows::UI::Xaml::Data::ICollectionView::IsCurrentBeforeFirst::get
{
return m_currentPosition < 0;
}
}
}
event Windows::Foundation::EventHandler<Platform::Object^>^ CurrentChanged
event Windows::Foundation::EventHandler<Platform::Object^>^ CurrentChanged
{
virtual Windows::Foundation::EventRegistrationToken add(Windows::Foundation::EventHandler<Platform::Object^>^ handler) = Windows::UI::Xaml::Data::ICollectionView::CurrentChanged::add
{
@@ -165,63 +162,67 @@ namespace CalculatorApp { namespace Common
// IVector<Object^>
// Not implemented methods
virtual void Append(Platform::Object^ /*item*/) = Windows::Foundation::Collections::IVector<Platform::Object^>::Append
{
throw ref new Platform::NotImplementedException();
}
virtual void Clear() = Windows::Foundation::Collections::IVector<Platform::Object^>::Clear
{
throw ref new Platform::NotImplementedException();
}
virtual unsigned int GetMany(unsigned int /*startIndex*/, Platform::WriteOnlyArray<Platform::Object^>^ /*items*/) = Windows::Foundation::Collections::IVector<Platform::Object^>::GetMany
{
throw ref new Platform::NotImplementedException();
}
virtual Windows::Foundation::Collections::IVectorView<Platform::Object^>^ GetView() = Windows::Foundation::Collections::IVector<Platform::Object^>::GetView
{
throw ref new Platform::NotImplementedException();
}
virtual void InsertAt(unsigned int /*index*/, Platform::Object^ /*item*/) = Windows::Foundation::Collections::IVector<Platform::Object^>::InsertAt
{
throw ref new Platform::NotImplementedException();
}
virtual void RemoveAt(unsigned int /*index*/) = Windows::Foundation::Collections::IVector<Platform::Object^>::RemoveAt
{
throw ref new Platform::NotImplementedException();
}
virtual void RemoveAtEnd() = Windows::Foundation::Collections::IVector<Platform::Object^>::RemoveAtEnd
{
throw ref new Platform::NotImplementedException();
}
virtual void ReplaceAll(const Platform::Array<Platform::Object^>^ /*items*/) = Windows::Foundation::Collections::IVector<Platform::Object^>::ReplaceAll
{
throw ref new Platform::NotImplementedException();
}
virtual void SetAt(unsigned int /*index*/, Platform::Object^ /*item*/) = Windows::Foundation::Collections::IVector<Platform::Object^>::SetAt
{
throw ref new Platform::NotImplementedException();
}
// Implemented methods
virtual Platform::Object^ GetAt(unsigned int index) = Windows::Foundation::Collections::IVector<Platform::Object^>::GetAt
{
return m_source->GetAt(index);
}
virtual bool IndexOf(Platform::Object^ item, unsigned int* index) = Windows::Foundation::Collections::IVector<Platform::Object^>::IndexOf
{
return m_source->IndexOf(item, index);
}
property unsigned int Size
{
virtual unsigned int get() = Windows::Foundation::Collections::IVector<Platform::Object^>::Size::get
{
return m_source->Size;
throw ref new Platform::NotImplementedException();
}
virtual void Clear() = Windows::Foundation::Collections::IVector<Platform::Object ^>::Clear
{
throw ref new Platform::NotImplementedException();
}
virtual unsigned int GetMany(
unsigned int /*startIndex*/,
Platform::WriteOnlyArray<Platform::Object ^> ^ /*items*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::GetMany
{
throw ref new Platform::NotImplementedException();
}
virtual Windows::Foundation::Collections::IVectorView<Platform::Object ^> ^ GetView() = Windows::Foundation::Collections::IVector<
Platform::Object ^>::GetView
{
throw ref new Platform::NotImplementedException();
}
virtual void InsertAt(unsigned int /*index*/, Platform::Object ^ /*item*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::InsertAt
{
throw ref new Platform::NotImplementedException();
}
virtual void RemoveAt(unsigned int /*index*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::RemoveAt
{
throw ref new Platform::NotImplementedException();
}
virtual void RemoveAtEnd() = Windows::Foundation::Collections::IVector<Platform::Object ^>::RemoveAtEnd
{
throw ref new Platform::NotImplementedException();
}
virtual void
ReplaceAll(const Platform::Array<Platform::Object ^> ^ /*items*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::ReplaceAll
{
throw ref new Platform::NotImplementedException();
}
virtual void SetAt(unsigned int /*index*/, Platform::Object ^ /*item*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::SetAt
{
throw ref new Platform::NotImplementedException();
}
}
// IObservableVector<Object^>
event Windows::Foundation::Collections::VectorChangedEventHandler<Platform::Object^>^ VectorChanged
// Implemented methods
virtual Platform::Object ^ GetAt(unsigned int index) = Windows::Foundation::Collections::IVector<Platform::Object ^>::GetAt
{
return m_source->GetAt(index);
}
virtual bool IndexOf(Platform::Object ^ item, unsigned int* index) = Windows::Foundation::Collections::IVector<Platform::Object ^>::IndexOf
{
return m_source->IndexOf(item, index);
}
property unsigned int Size
{
virtual unsigned int get() = Windows::Foundation::Collections::IVector<Platform::Object ^>::Size::get
{
return m_source->Size;
}
}
// IObservableVector<Object^>
event Windows::Foundation::Collections::VectorChangedEventHandler<Platform::Object^>^ VectorChanged
{
virtual Windows::Foundation::EventRegistrationToken add(Windows::Foundation::Collections::VectorChangedEventHandler<Platform::Object^>^ handler) = Windows::Foundation::Collections::IObservableVector<Platform::Object^>::VectorChanged::add
{
@@ -236,52 +237,57 @@ namespace CalculatorApp { namespace Common
// IIterable<Object^>
// Not implemented
virtual Windows::Foundation::Collections::IIterator<Platform::Object^>^ First() = Windows::Foundation::Collections::IIterable<Platform::Object^>::First
{
throw ref new Platform::NotImplementedException();
}
// Event handlers
void OnSourceBindableVectorChanged(Windows::UI::Xaml::Interop::IBindableObservableVector^ source, Platform::Object^ e)
{
Windows::Foundation::Collections::IVectorChangedEventArgs^ args = safe_cast<Windows::Foundation::Collections::IVectorChangedEventArgs^>(e);
m_vectorChanged(this, args);
}
Windows::UI::Xaml::Interop::IBindableVector^ m_source;
int m_currentPosition;
event Windows::Foundation::EventHandler<Platform::Object^>^ m_currentChanged;
event Windows::UI::Xaml::Data::CurrentChangingEventHandler^ m_currentChanging;
event Windows::Foundation::Collections::VectorChangedEventHandler<Platform::Object^>^ m_vectorChanged;
};
public ref class AlwaysSelectedCollectionViewConverter sealed: public Windows::UI::Xaml::Data::IValueConverter
{
public:
AlwaysSelectedCollectionViewConverter()
{ }
private:
virtual Platform::Object^ Convert(
Platform::Object^ value,
Windows::UI::Xaml::Interop::TypeName /*targetType*/,
Platform::Object^ /*parameter*/,
Platform::String^ /*language*/) = Windows::UI::Xaml::Data::IValueConverter::Convert
{
auto result = dynamic_cast<Windows::UI::Xaml::Interop::IBindableVector^>(value);
if (result)
{
return ref new AlwaysSelectedCollectionView(result);
throw ref new Platform::NotImplementedException();
}
return Windows::UI::Xaml::DependencyProperty::UnsetValue; // Can't convert
}
virtual Platform::Object^ ConvertBack(
Platform::Object^ /*value*/,
Windows::UI::Xaml::Interop::TypeName /*targetType*/,
Platform::Object^ /*parameter*/,
Platform::String^ /*language*/) = Windows::UI::Xaml::Data::IValueConverter::ConvertBack
// Event handlers
void OnSourceBindableVectorChanged(Windows::UI::Xaml::Interop::IBindableObservableVector ^ source, Platform::Object ^ e)
{
Windows::Foundation::Collections::IVectorChangedEventArgs ^ args = safe_cast<Windows::Foundation::Collections::IVectorChangedEventArgs ^>(e);
m_vectorChanged(this, args);
}
Windows::UI::Xaml::Interop::IBindableVector ^ m_source;
int m_currentPosition;
event Windows::Foundation::EventHandler<Platform::Object ^> ^ m_currentChanged;
event Windows::UI::Xaml::Data::CurrentChangingEventHandler ^ m_currentChanging;
event Windows::Foundation::Collections::VectorChangedEventHandler<Platform::Object ^> ^ m_vectorChanged;
};
public
ref class AlwaysSelectedCollectionViewConverter sealed : public Windows::UI::Xaml::Data::IValueConverter
{
return Windows::UI::Xaml::DependencyProperty::UnsetValue;
}
};
}}
public:
AlwaysSelectedCollectionViewConverter()
{
}
private:
virtual Platform::Object
^ Convert(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName /*targetType*/,
Platform::Object ^ /*parameter*/,
Platform::String ^ /*language*/) = Windows::UI::Xaml::Data::IValueConverter::Convert
{
auto result = dynamic_cast<Windows::UI::Xaml::Interop::IBindableVector ^>(value);
if (result)
{
return ref new AlwaysSelectedCollectionView(result);
}
return Windows::UI::Xaml::DependencyProperty::UnsetValue; // Can't convert
}
virtual Platform::Object
^ ConvertBack(
Platform::Object ^ /*value*/,
Windows::UI::Xaml::Interop::TypeName /*targetType*/,
Platform::Object ^ /*parameter*/,
Platform::String ^ /*language*/) = Windows::UI::Xaml::Data::IValueConverter::ConvertBack
{
return Windows::UI::Xaml::DependencyProperty::UnsetValue;
}
};
}
}

View File

@@ -15,14 +15,13 @@ using namespace winrt::Windows::UI::ViewManagement;
namespace CalculatorApp
{
#ifdef SEND_TELEMETRY
// c.f. WINEVENT_KEYWORD_RESERVED_63-56 0xFF00000000000000 // Bits 63-56 - channel keywords
// c.f. WINEVENT_KEYWORD_* 0x00FF000000000000 // Bits 55-48 - system-reserved keywords
constexpr int64_t MICROSOFT_KEYWORD_CRITICAL_DATA = 0x0000800000000000; // Bit 47
constexpr int64_t MICROSOFT_KEYWORD_MEASURES = 0x0000400000000000; // Bit 46
constexpr int64_t MICROSOFT_KEYWORD_TELEMETRY = 0x0000200000000000; // Bit 45
constexpr int64_t MICROSOFT_KEYWORD_RESERVED_44 = 0x0000100000000000; // Bit 44 (reserved for future assignment)
constexpr int64_t MICROSOFT_KEYWORD_MEASURES = 0x0000400000000000; // Bit 46
constexpr int64_t MICROSOFT_KEYWORD_TELEMETRY = 0x0000200000000000; // Bit 45
constexpr int64_t MICROSOFT_KEYWORD_RESERVED_44 = 0x0000100000000000; // Bit 44 (reserved for future assignment)
#else
// define all Keyword options as 0 when we do not want to upload app telemetry
constexpr int64_t MICROSOFT_KEYWORD_CRITICAL_DATA = 0;
@@ -33,8 +32,8 @@ namespace CalculatorApp
#pragma region TraceLogger setup and cleanup
AppLifecycleLogger::AppLifecycleLogger() :
m_appLifecycleProvider(
AppLifecycleLogger::AppLifecycleLogger()
: m_appLifecycleProvider(
L"Microsoft.Windows.AppLifeCycle",
LoggingChannelOptions(GUID{ 0x4f50731a, 0x89cf, 0x4782, 0xb3, 0xe0, 0xdc, 0xe8, 0xc9, 0x4, 0x76, 0xba }), // Microsoft Telemetry group
GUID{ 0xef00584a, 0x2655, 0x462c, 0xbc, 0x24, 0xe7, 0xde, 0x63, 0xe, 0x7f, 0xbf }) // Unique provider ID {EF00584A-2655-462C-BC24-E7DE630E7FBF}
@@ -59,13 +58,15 @@ namespace CalculatorApp
#pragma region Tracing methods
void AppLifecycleLogger::LogAppLifecycleEvent(hstring const& eventName, LoggingFields const& fields) const
{
m_appLifecycleProvider.LogEvent(eventName, fields, LoggingLevel::Information, LoggingOptions(MICROSOFT_KEYWORD_TELEMETRY | WINEVENT_KEYWORD_RESPONSE_TIME));
m_appLifecycleProvider.LogEvent(
eventName, fields, LoggingLevel::Information, LoggingOptions(MICROSOFT_KEYWORD_TELEMETRY | WINEVENT_KEYWORD_RESPONSE_TIME));
}
#pragma endregion
void AppLifecycleLogger::LaunchUIResponsive() const
{
if (!GetTraceLoggingProviderEnabled()) return;
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
@@ -74,7 +75,8 @@ namespace CalculatorApp
void AppLifecycleLogger::LaunchVisibleComplete() const
{
if (!GetTraceLoggingProviderEnabled()) return;
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
@@ -83,7 +85,8 @@ namespace CalculatorApp
void AppLifecycleLogger::ResumeUIResponsive() const
{
if (!GetTraceLoggingProviderEnabled()) return;
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
@@ -92,7 +95,8 @@ namespace CalculatorApp
void AppLifecycleLogger::ResumeVisibleComplete() const
{
if (!GetTraceLoggingProviderEnabled()) return;
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
@@ -106,7 +110,8 @@ namespace CalculatorApp
void AppLifecycleLogger::ResizeUIResponsive(int32_t viewId) const
{
if (!GetTraceLoggingProviderEnabled()) return;
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
@@ -121,7 +126,8 @@ namespace CalculatorApp
void AppLifecycleLogger::ResizeVisibleComplete(int32_t viewId) const
{
if (!GetTraceLoggingProviderEnabled()) return;
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
@@ -141,6 +147,3 @@ namespace CalculatorApp
fields.AddString(L"PsmKey", psmKey);
}
}

View File

@@ -9,7 +9,7 @@ namespace CalculatorApp
{
public:
AppLifecycleLogger(AppLifecycleLogger const&) = delete;
AppLifecycleLogger const & operator= (AppLifecycleLogger const&) = delete;
AppLifecycleLogger const& operator=(AppLifecycleLogger const&) = delete;
~AppLifecycleLogger();
static AppLifecycleLogger& GetInstance();
bool GetTraceLoggingProviderEnabled() const;
@@ -29,10 +29,10 @@ namespace CalculatorApp
AppLifecycleLogger();
// Any new Log method should
// a) Decide the level of logging. This will help us in limiting recording of events only up to a certain level. See this link for guidance https://msdn.microsoft.com/en-us/library/windows/desktop/aa363742(v=vs.85).aspx
// We're using Verbose level for events that are called frequently and needed only for debugging or capturing perf for specific scenarios
// b) Should decide whether or not to log to telemetry and pass TraceLoggingKeyword(MICROSOFT_KEYWORD_TELEMETRY) accordingly
// c) Should accept a variable number of additional data arguments if needed
// a) Decide the level of logging. This will help us in limiting recording of events only up to a certain level. See this link for guidance
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363742(v=vs.85).aspx We're using Verbose level for events that are called frequently and
// needed only for debugging or capturing perf for specific scenarios b) Should decide whether or not to log to telemetry and pass
// TraceLoggingKeyword(MICROSOFT_KEYWORD_TELEMETRY) accordingly c) Should accept a variable number of additional data arguments if needed
void LogAppLifecycleEvent(winrt::hstring const& eventName, winrt::Windows::Foundation::Diagnostics::LoggingFields const& fields) const;
void PopulateAppInfo(winrt::Windows::Foundation::Diagnostics::LoggingFields& fields) const;

View File

@@ -13,22 +13,22 @@ using namespace Windows::UI::Xaml::Data;
/// Notifies listeners that a property value has changed.
/// </summary>
/// <param name="propertyName">Name of the property used to notify listeners.</param>
void BindableBase::OnPropertyChanged(String^ propertyName)
void BindableBase::OnPropertyChanged(String ^ propertyName)
{
PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
}
Windows::UI::Xaml::Data::ICustomProperty^ BindableBase::GetCustomProperty(Platform::String^ name)
Windows::UI::Xaml::Data::ICustomProperty ^ BindableBase::GetCustomProperty(Platform::String ^ name)
{
return nullptr;
}
Windows::UI::Xaml::Data::ICustomProperty^ BindableBase::GetIndexedProperty(Platform::String^ name, Windows::UI::Xaml::Interop::TypeName type)
Windows::UI::Xaml::Data::ICustomProperty ^ BindableBase::GetIndexedProperty(Platform::String ^ name, Windows::UI::Xaml::Interop::TypeName type)
{
return nullptr;
}
Platform::String^ BindableBase::GetStringRepresentation()
Platform::String ^ BindableBase::GetStringRepresentation()
{
return this->ToString();
}

View File

@@ -10,26 +10,29 @@ namespace CalculatorApp
/// <summary>
/// Implementation of <see cref="INotifyPropertyChanged"/> to simplify models.
/// </summary>
[Windows::Foundation::Metadata::WebHostHidden]
public ref class BindableBase : Windows::UI::Xaml::DependencyObject, Windows::UI::Xaml::Data::INotifyPropertyChanged, Windows::UI::Xaml::Data::ICustomPropertyProvider
[Windows::Foundation::Metadata::WebHostHidden] public ref class BindableBase : Windows::UI::Xaml::DependencyObject,
Windows::UI::Xaml::Data::INotifyPropertyChanged,
Windows::UI::Xaml::Data::ICustomPropertyProvider
{
public:
virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler^ PropertyChanged;
virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler ^ PropertyChanged;
public:
// ICustomPropertyProvider
virtual Windows::UI::Xaml::Data::ICustomProperty^ GetCustomProperty(Platform::String^ name);
virtual Windows::UI::Xaml::Data::ICustomProperty^ GetIndexedProperty(Platform::String^ name, Windows::UI::Xaml::Interop::TypeName type);
virtual Platform::String^ GetStringRepresentation();
virtual Windows::UI::Xaml::Data::ICustomProperty ^ GetCustomProperty(Platform::String ^ name);
virtual Windows::UI::Xaml::Data::ICustomProperty ^ GetIndexedProperty(Platform::String ^ name, Windows::UI::Xaml::Interop::TypeName type);
virtual Platform::String ^ GetStringRepresentation();
property Windows::UI::Xaml::Interop::TypeName Type
{
virtual Windows::UI::Xaml::Interop::TypeName get() { return this->GetType(); }
virtual Windows::UI::Xaml::Interop::TypeName get()
{
return this->GetType();
}
}
protected:
virtual void OnPropertyChanged(Platform::String^ propertyName);
virtual void OnPropertyChanged(Platform::String ^ propertyName);
};
}
}

View File

@@ -1,94 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "TitleBarHelper.h"
#include "Converters/BooleanToVisibilityConverter.h"
#include "CalcViewModel/ViewState.h"
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Converters;
using namespace Platform;
using namespace std;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::Foundation;
using namespace Windows::UI::Xaml;
unique_ptr<TitleBarHelper> TitleBarHelper::CreateTitleBarHelperIfNotDocked(FrameworkElement^ customTitleBar)
{
return (App::GetAppViewState() == ViewState::DockedView)
? nullptr
: CalculatorApp::Common::TitleBarHelper::CreateTitleBarHelper(customTitleBar);
}
unique_ptr<TitleBarHelper> TitleBarHelper::CreateTitleBarHelper(_In_ FrameworkElement^ customTitleBar)
{
assert(customTitleBar != nullptr);
if (customTitleBar != nullptr)
{
CoreApplicationViewTitleBar^ coreTitleBar = CoreApplication::GetCurrentView()->TitleBar;
assert(coreTitleBar != nullptr);
if (coreTitleBar != nullptr)
{
return make_unique<TitleBarHelper>(coreTitleBar, customTitleBar);
}
}
return nullptr;
}
TitleBarHelper::TitleBarHelper(_In_ CoreApplicationViewTitleBar^ coreTitleBar, _In_ FrameworkElement^ customTitleBar) :
m_coreTitleBar(coreTitleBar),
m_customTitleBar(customTitleBar)
{
RegisterForLayoutChanged();
RegisterForVisibilityChanged();
SetCustomTitleBar();
}
TitleBarHelper::~TitleBarHelper()
{
m_coreTitleBar->LayoutMetricsChanged -= m_layoutChangedToken;
m_coreTitleBar->IsVisibleChanged -= m_visibilityChangedToken;
}
void TitleBarHelper::SetTitleBarHeight(double height)
{
m_customTitleBar->Height = height;
}
void TitleBarHelper::SetTitleBarVisibility(bool isVisible)
{
m_customTitleBar->Visibility = BooleanToVisibilityConverter::Convert(isVisible);
}
void TitleBarHelper::RegisterForLayoutChanged()
{
m_layoutChangedToken =
m_coreTitleBar->LayoutMetricsChanged += ref new TypedEventHandler<CoreApplicationViewTitleBar^, Object^>(
[this](CoreApplicationViewTitleBar^ cTitleBar, Object^)
{
// Update title bar control size as needed to account for system size changes
SetTitleBarHeight(cTitleBar->Height);
});
}
void TitleBarHelper::RegisterForVisibilityChanged()
{
m_visibilityChangedToken =
m_coreTitleBar->IsVisibleChanged += ref new TypedEventHandler<CoreApplicationViewTitleBar^, Object^>(
[this](CoreApplicationViewTitleBar^ cTitleBar, Object^)
{
// Update title bar visibility
SetTitleBarVisibility(cTitleBar->IsVisible);
});
}
void TitleBarHelper::SetCustomTitleBar()
{
// Set custom XAML Title Bar
m_coreTitleBar->ExtendViewIntoTitleBar = true;
SetTitleBarHeight(m_coreTitleBar->Height);
SetTitleBarVisibility(m_coreTitleBar->IsVisible);
Window::Current->SetTitleBar(m_customTitleBar);
}

View File

@@ -1,40 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
namespace CalculatorApp
{
namespace Common
{
class TitleBarHelper
{
public:
static std::unique_ptr<TitleBarHelper> CreateTitleBarHelperIfNotDocked(
_In_ Windows::UI::Xaml::FrameworkElement^ customTitleBar);
// Prefer CreateTitleBarHelper over constructing your own instance,
// because Create* will nullcheck the parameters.
static std::unique_ptr<TitleBarHelper> CreateTitleBarHelper(
_In_ Windows::UI::Xaml::FrameworkElement^ customTitleBar);
TitleBarHelper(
_In_ Windows::ApplicationModel::Core::CoreApplicationViewTitleBar^ coreTitleBar,
_In_ Windows::UI::Xaml::FrameworkElement^ customTitleBar);
~TitleBarHelper();
void SetTitleBarHeight(double height);
void SetTitleBarVisibility(bool isVisible);
private:
void RegisterForLayoutChanged();
void RegisterForVisibilityChanged();
void SetCustomTitleBar();
Platform::Agile<Windows::ApplicationModel::Core::CoreApplicationViewTitleBar^> m_coreTitleBar;
Windows::UI::Xaml::FrameworkElement^ m_customTitleBar;
Windows::Foundation::EventRegistrationToken m_layoutChangedToken;
Windows::Foundation::EventRegistrationToken m_visibilityChangedToken;
};
}
}

View File

@@ -1,29 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "Common/KeyboardShortcutManager.h"
namespace CalculatorApp
{
namespace Controls
{
public ref class AppBar sealed : public Windows::UI::Xaml::Controls::AppBar
{
public:
AppBar()
{}
protected:
virtual void OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e) override
{
Windows::UI::Xaml::Controls::AppBar::OnKeyDown(e);
if (e->Key == Windows::System::VirtualKey::Escape)
{
Common::KeyboardShortcutManager::IgnoreEscape(true);
}
}
};
}
}

View File

@@ -50,13 +50,13 @@ DEPENDENCY_PROPERTY_INITIALIZATION(CalculationResult, DisplayStringExpression);
StringReference CalculationResult::s_FocusedState(L"Focused");
StringReference CalculationResult::s_UnfocusedState(L"Unfocused");
CalculationResult::CalculationResult():
m_isScalingText(false),
m_haveCalculatedMax(false)
CalculationResult::CalculationResult()
: m_isScalingText(false)
, m_haveCalculatedMax(false)
{
}
Platform::String^ CalculationResult::GetRawDisplayValue()
Platform::String ^ CalculationResult::GetRawDisplayValue()
{
std::wstring rawValue;
@@ -72,18 +72,19 @@ void CalculationResult::OnApplyTemplate()
{
m_textContainer->LayoutUpdated -= m_textContainerLayoutChangedToken;
}
m_textContainer = dynamic_cast<ScrollViewer^>(GetTemplateChild("textContainer"));
m_textContainer = dynamic_cast<ScrollViewer ^>(GetTemplateChild("TextContainer"));
if (m_textContainer)
{
m_textContainer->SizeChanged += ref new SizeChangedEventHandler(this, &CalculationResult::TextContainerSizeChanged);
// We want to know when the size of the container changes so
// we can rescale the textbox
m_textContainerLayoutChangedToken = m_textContainer->LayoutUpdated += ref new EventHandler<Object^>(this, &CalculationResult::OnTextContainerLayoutUpdated);
m_textContainerLayoutChangedToken = m_textContainer->LayoutUpdated +=
ref new EventHandler<Object ^>(this, &CalculationResult::OnTextContainerLayoutUpdated);
m_textContainer->ChangeView(m_textContainer->ExtentWidth - m_textContainer->ViewportWidth,nullptr,nullptr);
m_scrollLeft = dynamic_cast<HyperlinkButton^>(GetTemplateChild("scrollLeft"));
m_scrollRight = dynamic_cast<HyperlinkButton^>(GetTemplateChild("scrollRight"));
auto borderContainer = dynamic_cast<UIElement^>(GetTemplateChild("border"));
m_textContainer->ChangeView(m_textContainer->ExtentWidth - m_textContainer->ViewportWidth, nullptr, nullptr);
m_scrollLeft = dynamic_cast<HyperlinkButton ^>(GetTemplateChild("ScrollLeft"));
m_scrollRight = dynamic_cast<HyperlinkButton ^>(GetTemplateChild("ScrollRight"));
auto borderContainer = dynamic_cast<UIElement ^>(GetTemplateChild("Border"));
if (m_scrollLeft && m_scrollRight)
{
m_scrollLeft->Click += ref new RoutedEventHandler(this, &CalculationResult::OnScrollClick);
@@ -91,7 +92,7 @@ void CalculationResult::OnApplyTemplate()
borderContainer->PointerEntered += ref new PointerEventHandler(this, &CalculationResult::OnPointerEntered);
borderContainer->PointerExited += ref new PointerEventHandler(this, &CalculationResult::OnPointerExited);
}
m_textBlock = dynamic_cast<TextBlock^>(m_textContainer->FindName("normalOutput"));
m_textBlock = dynamic_cast<TextBlock ^>(m_textContainer->FindName("NormalOutput"));
if (m_textBlock)
{
m_textBlock->Visibility = ::Visibility::Visible;
@@ -101,7 +102,7 @@ void CalculationResult::OnApplyTemplate()
VisualStateManager::GoToState(this, s_UnfocusedState, false);
}
void CalculationResult::OnPointerPressed(PointerRoutedEventArgs^ e)
void CalculationResult::OnPointerPressed(PointerRoutedEventArgs ^ e)
{
if (m_scrollLeft && m_scrollRight && e->Pointer->PointerDeviceType == PointerDeviceType::Touch)
{
@@ -109,7 +110,7 @@ void CalculationResult::OnPointerPressed(PointerRoutedEventArgs^ e)
}
}
void CalculationResult::OnTextContainerLayoutUpdated(Object^ /*sender*/, Object^ /*e*/)
void CalculationResult::OnTextContainerLayoutUpdated(Object ^ /*sender*/, Object ^ /*e*/)
{
if (m_isScalingText)
{
@@ -117,7 +118,7 @@ void CalculationResult::OnTextContainerLayoutUpdated(Object^ /*sender*/, Object^
}
}
void CalculationResult::TextContainerSizeChanged(Object^ /*sender*/, SizeChangedEventArgs^ /*e*/)
void CalculationResult::TextContainerSizeChanged(Object ^ /*sender*/, SizeChangedEventArgs ^ /*e*/)
{
UpdateTextState();
}
@@ -127,7 +128,7 @@ void CalculationResult::OnIsActivePropertyChanged(bool /*oldValue*/, bool /*newV
UpdateVisualState();
}
void CalculationResult::OnAccentColorPropertyChanged(Brush^ /*oldValue*/, Brush^ /*newValue*/)
void CalculationResult::OnAccentColorPropertyChanged(Brush ^ /*oldValue*/, Brush ^ /*newValue*/)
{
// Force the "Active" transition to happen again
if (IsActive)
@@ -137,7 +138,7 @@ void CalculationResult::OnAccentColorPropertyChanged(Brush^ /*oldValue*/, Brush^
}
}
void CalculationResult::OnDisplayValuePropertyChanged(String^ /*oldValue*/, String^ /*newValue*/)
void CalculationResult::OnDisplayValuePropertyChanged(String ^ /*oldValue*/, String ^ /*newValue*/)
{
UpdateTextState();
}
@@ -198,8 +199,8 @@ void CalculationResult::UpdateTextState()
}
auto containerSize = m_textContainer->ActualWidth;
String^ oldText = m_textBlock->Text;
String^ newText = Utils::LRO + DisplayValue + Utils::PDF;
String ^ oldText = m_textBlock->Text;
String ^ newText = Utils::LRO + DisplayValue + Utils::PDF;
// Initiate the scaling operation
// UpdateLayout will keep calling us until we make it through the below 2 if-statements
@@ -241,11 +242,11 @@ void CalculationResult::UpdateTextState()
m_isScalingText = false;
if (IsOperatorCommand)
{
m_textContainer->ChangeView(0.0,nullptr,nullptr);
m_textContainer->ChangeView(0.0, nullptr, nullptr);
}
else
{
m_textContainer->ChangeView(m_textContainer->ExtentWidth - m_textContainer->ViewportWidth,nullptr,nullptr);
m_textContainer->ChangeView(m_textContainer->ExtentWidth - m_textContainer->ViewportWidth, nullptr, nullptr);
}
if (m_scrollLeft && m_scrollRight)
@@ -292,7 +293,7 @@ void CalculationResult::ScrollRight()
}
}
void CalculationResult::OnKeyDown(KeyRoutedEventArgs^ e)
void CalculationResult::OnKeyDown(KeyRoutedEventArgs ^ e)
{
if (m_scrollLeft != nullptr && m_scrollRight != nullptr)
{
@@ -308,9 +309,9 @@ void CalculationResult::OnKeyDown(KeyRoutedEventArgs^ e)
}
}
void CalculationResult::OnScrollClick(Object^ sender, RoutedEventArgs^ /*e*/)
void CalculationResult::OnScrollClick(Object ^ sender, RoutedEventArgs ^ /*e*/)
{
auto clicked = dynamic_cast<HyperlinkButton^>(sender);
auto clicked = dynamic_cast<HyperlinkButton ^>(sender);
if (clicked == m_scrollLeft)
{
this->ScrollLeft();
@@ -321,7 +322,7 @@ void CalculationResult::OnScrollClick(Object^ sender, RoutedEventArgs^ /*e*/)
}
}
void CalculationResult::OnPointerEntered(Platform::Object^ sender, PointerRoutedEventArgs^ e)
void CalculationResult::OnPointerEntered(Platform::Object ^ sender, PointerRoutedEventArgs ^ e)
{
if (e->Pointer->PointerDeviceType == PointerDeviceType::Mouse && m_textBlock->ActualWidth >= m_textContainer->ActualWidth)
{
@@ -358,7 +359,7 @@ void CalculationResult::UpdateScrollButtons()
}
}
void CalculationResult::OnPointerExited(Platform::Object^ sender, PointerRoutedEventArgs^ e)
void CalculationResult::OnPointerExited(Platform::Object ^ sender, PointerRoutedEventArgs ^ e)
{
if (e->Pointer->PointerDeviceType == PointerDeviceType::Mouse)
{
@@ -366,7 +367,7 @@ void CalculationResult::OnPointerExited(Platform::Object^ sender, PointerRoutedE
}
}
void CalculationResult::ModifyFontAndMargin(TextBlock^ textBox, double fontChange)
void CalculationResult::ModifyFontAndMargin(TextBlock ^ textBox, double fontChange)
{
double cur = textBox->FontSize;
double newFontSize = 0.0;
@@ -387,18 +388,18 @@ void CalculationResult::UpdateAllState()
UpdateTextState();
}
void CalculationResult::OnTapped(TappedRoutedEventArgs^ e)
void CalculationResult::OnTapped(TappedRoutedEventArgs ^ e)
{
this->Focus(::FocusState::Programmatic);
RaiseSelectedEvent();
}
void CalculationResult::OnRightTapped(RightTappedRoutedEventArgs^ e)
void CalculationResult::OnRightTapped(RightTappedRoutedEventArgs ^ e)
{
this->Focus(::FocusState::Programmatic);
}
void CalculationResult::OnGotFocus(RoutedEventArgs^ e)
void CalculationResult::OnGotFocus(RoutedEventArgs ^ e)
{
if (this->FocusState == ::FocusState::Keyboard)
{
@@ -406,12 +407,12 @@ void CalculationResult::OnGotFocus(RoutedEventArgs^ e)
}
}
void CalculationResult::OnLostFocus(RoutedEventArgs^ e)
void CalculationResult::OnLostFocus(RoutedEventArgs ^ e)
{
VisualStateManager::GoToState(this, s_UnfocusedState, true);
}
AutomationPeer^ CalculationResult::OnCreateAutomationPeer()
AutomationPeer ^ CalculationResult::OnCreateAutomationPeer()
{
return ref new CalculationResultAutomationPeer(this);
}

View File

@@ -9,9 +9,11 @@ namespace CalculatorApp
{
namespace Controls
{
public delegate void SelectedEventHandler(Platform::Object^ sender);
public
delegate void SelectedEventHandler(Platform::Object ^ sender);
public ref class CalculationResult sealed: public Windows::UI::Xaml::Controls::Control
public
ref class CalculationResult sealed : public Windows::UI::Xaml::Controls::Control
{
public:
CalculationResult();
@@ -24,45 +26,44 @@ namespace CalculatorApp
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Thickness, DisplayMargin);
DEPENDENCY_PROPERTY(int, MaxExpressionHistoryCharacters);
DEPENDENCY_PROPERTY_WITH_CALLBACK(bool, IsActive);
DEPENDENCY_PROPERTY_WITH_CALLBACK(Windows::UI::Xaml::Media::Brush^, AccentColor);
DEPENDENCY_PROPERTY_WITH_CALLBACK(Platform::String^, DisplayValue);
DEPENDENCY_PROPERTY(Platform::String^, DisplayStringExpression);
DEPENDENCY_PROPERTY_WITH_CALLBACK(Windows::UI::Xaml::Media::Brush ^, AccentColor);
DEPENDENCY_PROPERTY_WITH_CALLBACK(Platform::String ^, DisplayValue);
DEPENDENCY_PROPERTY(Platform::String ^, DisplayStringExpression);
DEPENDENCY_PROPERTY_WITH_CALLBACK(bool, IsInError);
DEPENDENCY_PROPERTY_WITH_DEFAULT(bool, IsOperatorCommand, false);
event SelectedEventHandler^ Selected;
event SelectedEventHandler ^ Selected;
void ProgrammaticSelect();
internal:
void UpdateTextState();
Platform::String^ GetRawDisplayValue();
internal : void UpdateTextState();
Platform::String ^ GetRawDisplayValue();
protected:
virtual void OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e) override;
virtual void OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e) override;
virtual void OnApplyTemplate() override;
virtual void OnTapped(Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e) override;
virtual void OnPointerPressed(Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e) override;
virtual void OnRightTapped(Windows::UI::Xaml::Input::RightTappedRoutedEventArgs^ e) override;
virtual void OnGotFocus(Windows::UI::Xaml::RoutedEventArgs^ e) override;
virtual void OnLostFocus(Windows::UI::Xaml::RoutedEventArgs^ e) override;
virtual void OnTapped(Windows::UI::Xaml::Input::TappedRoutedEventArgs ^ e) override;
virtual void OnPointerPressed(Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e) override;
virtual void OnRightTapped(Windows::UI::Xaml::Input::RightTappedRoutedEventArgs ^ e) override;
virtual void OnGotFocus(Windows::UI::Xaml::RoutedEventArgs ^ e) override;
virtual void OnLostFocus(Windows::UI::Xaml::RoutedEventArgs ^ e) override;
virtual Windows::UI::Xaml::Automation::Peers::AutomationPeer^ OnCreateAutomationPeer() override;
virtual Windows::UI::Xaml::Automation::Peers::AutomationPeer ^ OnCreateAutomationPeer() override;
private:
void OnIsActivePropertyChanged(bool oldValue, bool newValue);
void OnAccentColorPropertyChanged(Windows::UI::Xaml::Media::Brush^ oldValue, Windows::UI::Xaml::Media::Brush^ newValue);
void OnDisplayValuePropertyChanged(Platform::String^ oldValue, Platform::String^ newValue);
void OnAccentColorPropertyChanged(Windows::UI::Xaml::Media::Brush ^ oldValue, Windows::UI::Xaml::Media::Brush ^ newValue);
void OnDisplayValuePropertyChanged(Platform::String ^ oldValue, Platform::String ^ newValue);
void OnIsInErrorPropertyChanged(bool oldValue, bool newValue);
void OnMinFontSizePropertyChanged(double oldValue, double newValue);
void OnMaxFontSizePropertyChanged(double oldValue, double newValue);
void TextContainerSizeChanged(Object^ sender, Windows::UI::Xaml::SizeChangedEventArgs^ e);
void OnTextContainerLayoutUpdated(Object^ sender, Object^ e);
void TextContainerSizeChanged(Object ^ sender, Windows::UI::Xaml::SizeChangedEventArgs ^ e);
void OnTextContainerLayoutUpdated(Object ^ sender, Object ^ e);
void UpdateVisualState();
void UpdateAllState();
void OnScrollClick(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void OnPointerEntered(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
void OnPointerExited(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
void ModifyFontAndMargin(Windows::UI::Xaml::Controls::TextBlock^ textBlock, double fontChange);
void OnScrollClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
void OnPointerEntered(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e);
void OnPointerExited(Platform::Object ^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e);
void ModifyFontAndMargin(Windows::UI::Xaml::Controls::TextBlock ^ textBlock, double fontChange);
void ShowHideScrollButtons(Windows::UI::Xaml::Visibility vLeft, Windows::UI::Xaml::Visibility vRight);
void UpdateScrollButtons();
void ScrollLeft();
@@ -73,10 +74,10 @@ namespace CalculatorApp
static Platform::StringReference s_FocusedState;
static Platform::StringReference s_UnfocusedState;
Windows::UI::Xaml::Controls::ScrollViewer^ m_textContainer;
Windows::UI::Xaml::Controls::TextBlock^ m_textBlock;
Windows::UI::Xaml::Controls::HyperlinkButton^ m_scrollLeft;
Windows::UI::Xaml::Controls::HyperlinkButton^ m_scrollRight;
Windows::UI::Xaml::Controls::ScrollViewer ^ m_textContainer;
Windows::UI::Xaml::Controls::TextBlock ^ m_textBlock;
Windows::UI::Xaml::Controls::HyperlinkButton ^ m_scrollLeft;
Windows::UI::Xaml::Controls::HyperlinkButton ^ m_scrollRight;
double scrollRatio = 0.7;
bool m_isScalingText;
bool m_haveCalculatedMax;

View File

@@ -9,16 +9,17 @@ using namespace Windows::UI::Xaml::Automation::Peers;
namespace CalculatorApp::Controls
{
CalculationResultAutomationPeer::CalculationResultAutomationPeer(FrameworkElement^ owner) :
FrameworkElementAutomationPeer(owner)
{ }
CalculationResultAutomationPeer::CalculationResultAutomationPeer(FrameworkElement ^ owner)
: FrameworkElementAutomationPeer(owner)
{
}
AutomationControlType CalculationResultAutomationPeer::GetAutomationControlTypeCore()
{
return AutomationControlType::Text;
}
Platform::Object^ CalculationResultAutomationPeer::GetPatternCore(PatternInterface pattern)
Platform::Object ^ CalculationResultAutomationPeer::GetPatternCore(PatternInterface pattern)
{
if (pattern == PatternInterface::Invoke)
{
@@ -30,7 +31,7 @@ namespace CalculatorApp::Controls
void CalculationResultAutomationPeer::Invoke()
{
auto owner = static_cast<CalculationResult^>(this->Owner);
auto owner = static_cast<CalculationResult ^>(this->Owner);
owner->ProgrammaticSelect();
}
}

View File

@@ -9,14 +9,15 @@ namespace CalculatorApp
{
namespace Controls
{
public ref class CalculationResultAutomationPeer sealed : Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer,
Windows::UI::Xaml::Automation::Provider::IInvokeProvider
public
ref class CalculationResultAutomationPeer sealed : Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer,
Windows::UI::Xaml::Automation::Provider::IInvokeProvider
{
public:
CalculationResultAutomationPeer(Windows::UI::Xaml::FrameworkElement^ owner);
CalculationResultAutomationPeer(Windows::UI::Xaml::FrameworkElement ^ owner);
virtual Windows::UI::Xaml::Automation::Peers::AutomationControlType GetAutomationControlTypeCore() override;
virtual Platform::Object^ GetPatternCore(Windows::UI::Xaml::Automation::Peers::PatternInterface pattern) override;
virtual Platform::Object ^ GetPatternCore(Windows::UI::Xaml::Automation::Peers::PatternInterface pattern) override;
virtual void Invoke();
};
}

View File

@@ -26,12 +26,12 @@ CalculatorButton::CalculatorButton()
{
// Set the default bindings for this button, these can be overwritten by Xaml if needed
// These are a replacement for binding in styles
Binding^ commandBinding = ref new Binding();
Binding ^ commandBinding = ref new Binding();
commandBinding->Path = ref new PropertyPath("ButtonPressed");
this->SetBinding(Button::CommandProperty, commandBinding);
}
void CalculatorButton::OnKeyDown(KeyRoutedEventArgs^ e)
void CalculatorButton::OnKeyDown(KeyRoutedEventArgs ^ e)
{
// Ignore the Enter key
if (e->Key == VirtualKey::Enter)
@@ -42,7 +42,7 @@ void CalculatorButton::OnKeyDown(KeyRoutedEventArgs^ e)
Button::OnKeyDown(e);
}
void CalculatorButton::OnKeyUp(KeyRoutedEventArgs^ e)
void CalculatorButton::OnKeyUp(KeyRoutedEventArgs ^ e)
{
// Ignore the Enter key
if (e->Key == VirtualKey::Enter)
@@ -53,16 +53,12 @@ void CalculatorButton::OnKeyUp(KeyRoutedEventArgs^ e)
Button::OnKeyUp(e);
}
void CalculatorButton::OnButtonIdPropertyChanged(
NumbersAndOperatorsEnum /*oldValue*/,
NumbersAndOperatorsEnum newValue)
void CalculatorButton::OnButtonIdPropertyChanged(NumbersAndOperatorsEnum /*oldValue*/, NumbersAndOperatorsEnum newValue)
{
this->CommandParameter = ref new CalculatorButtonPressedEventArgs(AuditoryFeedback, newValue);
}
void CalculatorButton::OnAuditoryFeedbackPropertyChanged(
String^ /*oldValue*/,
String^ newValue)
void CalculatorButton::OnAuditoryFeedbackPropertyChanged(String ^ /*oldValue*/, String ^ newValue)
{
this->CommandParameter = ref new CalculatorButtonPressedEventArgs(newValue, ButtonId);
}

View File

@@ -10,29 +10,27 @@ namespace CalculatorApp
{
namespace Controls
{
public ref class CalculatorButton sealed: Windows::UI::Xaml::Controls::Button
public
ref class CalculatorButton sealed : Windows::UI::Xaml::Controls::Button
{
public:
CalculatorButton();
DEPENDENCY_PROPERTY_OWNER(CalculatorButton);
DEPENDENCY_PROPERTY_WITH_CALLBACK(NumbersAndOperatorsEnum, ButtonId);
DEPENDENCY_PROPERTY_WITH_CALLBACK(Platform::String^, AuditoryFeedback);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush^, HoverBackground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush^, HoverForeground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush^, PressBackground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush^, PressForeground);
DEPENDENCY_PROPERTY_WITH_CALLBACK(Platform::String ^, AuditoryFeedback);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush ^, HoverBackground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush ^, HoverForeground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush ^, PressBackground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush ^, PressForeground);
protected:
virtual void OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e) override;
virtual void OnKeyUp(Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e) override;
virtual void OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e) override;
virtual void OnKeyUp(Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e) override;
private:
void OnButtonIdPropertyChanged(NumbersAndOperatorsEnum oldValue, NumbersAndOperatorsEnum newValue);
void OnAuditoryFeedbackPropertyChanged(Platform::String^ oldValue, Platform::String^ newValue);
void OnAuditoryFeedbackPropertyChanged(Platform::String ^ oldValue, Platform::String ^ newValue);
};
}
}

View File

@@ -19,8 +19,7 @@ DEPENDENCY_PROPERTY_INITIALIZATION(FlipButtons, HoverForeground);
DEPENDENCY_PROPERTY_INITIALIZATION(FlipButtons, PressBackground);
DEPENDENCY_PROPERTY_INITIALIZATION(FlipButtons, PressForeground);
void FlipButtons::OnKeyDown(KeyRoutedEventArgs^ e)
void FlipButtons::OnKeyDown(KeyRoutedEventArgs ^ e)
{
// Ignore the Enter key
if (e->Key == VirtualKey::Enter)
@@ -31,7 +30,7 @@ void FlipButtons::OnKeyDown(KeyRoutedEventArgs^ e)
ToggleButton::OnKeyDown(e);
}
void FlipButtons::OnKeyUp(KeyRoutedEventArgs^ e)
void FlipButtons::OnKeyUp(KeyRoutedEventArgs ^ e)
{
// Ignore the Enter key
if (e->Key == VirtualKey::Enter)
@@ -42,10 +41,7 @@ void FlipButtons::OnKeyUp(KeyRoutedEventArgs^ e)
ToggleButton::OnKeyUp(e);
}
void FlipButtons::OnButtonIdPropertyChanged(
NumbersAndOperatorsEnum /*oldValue*/,
NumbersAndOperatorsEnum newValue)
void FlipButtons::OnButtonIdPropertyChanged(NumbersAndOperatorsEnum /*oldValue*/, NumbersAndOperatorsEnum newValue)
{
this->CommandParameter = newValue;
}

View File

@@ -10,27 +10,24 @@ namespace CalculatorApp
{
namespace Controls
{
public ref class FlipButtons sealed: Windows::UI::Xaml::Controls::Primitives::ToggleButton
public
ref class FlipButtons sealed : Windows::UI::Xaml::Controls::Primitives::ToggleButton
{
public:
DEPENDENCY_PROPERTY_OWNER(FlipButtons);
DEPENDENCY_PROPERTY_WITH_CALLBACK(NumbersAndOperatorsEnum, ButtonId);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush^, HoverBackground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush^, HoverForeground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush^, PressBackground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush^, PressForeground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush ^, HoverBackground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush ^, HoverForeground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush ^, PressBackground);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Media::Brush ^, PressForeground);
protected:
virtual void OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e) override;
virtual void OnKeyUp(Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e) override;
virtual void OnKeyDown(Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e) override;
virtual void OnKeyUp(Windows::UI::Xaml::Input::KeyRoutedEventArgs ^ e) override;
private:
void OnButtonIdPropertyChanged(
NumbersAndOperatorsEnum oldValue,
NumbersAndOperatorsEnum newValue);
void OnButtonIdPropertyChanged(NumbersAndOperatorsEnum oldValue, NumbersAndOperatorsEnum newValue);
};
}
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
@@ -12,6 +12,8 @@
using namespace std;
using namespace CalculatorApp::Controls;
using namespace Windows::Foundation;
using namespace Windows::UI::Xaml::Automation;
using namespace Windows::UI::Xaml::Automation::Peers;
Size HorizontalNoOverflowStackPanel::MeasureOverride(Size availableSize)
{
@@ -55,16 +57,17 @@ Size HorizontalNoOverflowStackPanel::ArrangeOverride(Size finalSize)
float itemWidth = item->DesiredSize.Width;
if (widthAvailable > 0 && itemWidth <= widthAvailable)
{
//stack the items horizontally (left to right)
// stack the items horizontally (left to right)
item->Arrange(Rect(posX, 0, itemWidth, finalSize.Height));
AutomationProperties::SetAccessibilityView(item, ::AccessibilityView::Content);
posX += item->RenderSize.Width;
}
else
{
//Not display the item
// Not display the item
item->Arrange(Rect(0, 0, 0, 0));
AutomationProperties::SetAccessibilityView(item, ::AccessibilityView::Raw);
}
}
return finalSize;
}

View File

@@ -13,12 +13,15 @@ namespace CalculatorApp
{
namespace Controls
{
public ref class HorizontalNoOverflowStackPanel : public Windows::UI::Xaml::Controls::Panel
public
ref class HorizontalNoOverflowStackPanel : public Windows::UI::Xaml::Controls::Panel
{
DEPENDENCY_PROPERTY_OWNER(HorizontalNoOverflowStackPanel);
//Prioritize the last item over all other items (except the first one)
internal:
HorizontalNoOverflowStackPanel() {}
// Prioritize the last item over all other items (except the first one)
internal : HorizontalNoOverflowStackPanel()
{
}
protected:
virtual Windows::Foundation::Size MeasureOverride(Windows::Foundation::Size availableSize) override;
virtual Windows::Foundation::Size ArrangeOverride(Windows::Foundation::Size finalSize) override;

View File

@@ -1,58 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "OperandTextBox.h"
#include "regex"
using namespace CalculatorApp;
using namespace CalculatorApp::Controls;
using namespace Platform;
using namespace std;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Devices::Input;
using namespace Windows::System;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
void OperandTextBox::OnApplyTemplate()
{
this->IsEnabled = false;
this->IsHitTestVisible = false;
this->IsTapEnabled = false;
this->MaxLength = 50;
this->IsRightTapEnabled = false;
this->IsTabStop = false;
auto parent = VisualTreeHelper::GetParent(this);
ListViewItem^ listViewItem;
ListView^ listView;
while (parent != nullptr)
{
if (listViewItem == nullptr)
{
listViewItem = dynamic_cast<ListViewItem^>(parent);
}
listView = dynamic_cast<ListView^>(parent);
if (listView != nullptr)
{
break;
}
parent = VisualTreeHelper::GetParent(parent);
}
if (listView != nullptr)
{
listViewItem->IsEnabled = false;
listViewItem->IsHitTestVisible = false;
listViewItem->IsTapEnabled = false;
}
TextBox::OnApplyTemplate();
}

View File

@@ -1,19 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
namespace CalculatorApp
{
namespace Controls
{
public ref class OperandTextBox sealed : public Windows::UI::Xaml::Controls::TextBox
{
public:
OperandTextBox() { }
protected:
virtual void OnApplyTemplate() override;
};
}
}

View File

@@ -1,59 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "OperatorTextBox.h"
#include "regex"
using namespace CalculatorApp;
using namespace CalculatorApp::Controls;
using namespace Platform;
using namespace std;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Devices::Input;
using namespace Windows::System;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;
void OperatorTextBox::OnApplyTemplate()
{
this->IsEnabled = false;
this->IsHitTestVisible = false;
this->IsTapEnabled = false;
this->MaxLength = 50;
this->IsReadOnly = true;
this->IsRightTapEnabled = false;
this->IsTabStop = false;
auto parent = VisualTreeHelper::GetParent(this);
ListViewItem^ listViewItem;
ListView^ listView;
while (parent != nullptr)
{
if (listViewItem == nullptr)
{
listViewItem = dynamic_cast<ListViewItem^>(parent);
}
listView = dynamic_cast<ListView^>(parent);
if (listView != nullptr)
{
break;
}
parent = VisualTreeHelper::GetParent(parent);
}
if (listView != nullptr)
{
listViewItem->IsEnabled = false;
listViewItem->IsHitTestVisible = false;
listViewItem->IsTapEnabled = false;
}
TextBox::OnApplyTemplate();
}

View File

@@ -1,19 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
namespace CalculatorApp
{
namespace Controls
{
public ref class OperatorTextBox sealed : public Windows::UI::Xaml::Controls::TextBox
{
public:
OperatorTextBox() { }
protected:
virtual void OnApplyTemplate() override;
};
}
}

View File

@@ -30,48 +30,62 @@ DEPENDENCY_PROPERTY_INITIALIZATION(OverflowTextBlock, TokensUpdated);
void OverflowTextBlock::OnApplyTemplate()
{
assert(((m_scrollLeft == nullptr) && (m_scrollRight == nullptr)) || ((m_scrollLeft != nullptr) && (m_scrollRight != nullptr)));
UnregisterEventHandlers();
m_expressionContainer = safe_cast<ScrollViewer^>(GetTemplateChild("expressionContainer"));
m_expressionContainer->ChangeView(m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth, nullptr, nullptr);
auto uiElement = GetTemplateChild("ExpressionContainer");
if (uiElement != nullptr)
{
m_expressionContainer = safe_cast<ScrollViewer ^>(uiElement);
m_expressionContainer->ChangeView(m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth, nullptr, nullptr);
m_containerViewChangedToken = m_expressionContainer->ViewChanged +=
ref new EventHandler<ScrollViewerViewChangedEventArgs ^>(this, &OverflowTextBlock::OnViewChanged);
}
m_scrollLeft = safe_cast<Button^>(GetTemplateChild("scrollLeft"));
m_scrollRight = safe_cast<Button^>(GetTemplateChild("scrollRight"));
uiElement = GetTemplateChild("ScrollLeft");
if (uiElement != nullptr)
{
m_scrollLeft = safe_cast<Button ^>(uiElement);
m_scrollLeftClickEventToken = m_scrollLeft->Click += ref new RoutedEventHandler(this, &OverflowTextBlock::OnScrollClick);
}
m_scrollLeftClickEventToken = m_scrollLeft->Click += ref new RoutedEventHandler(this, &OverflowTextBlock::OnScrollClick);
m_scrollRightClickEventToken = m_scrollRight->Click += ref new RoutedEventHandler(this, &OverflowTextBlock::OnScrollClick);
uiElement = GetTemplateChild("ScrollRight");
if (uiElement != nullptr)
{
m_scrollRight = safe_cast<Button ^>(uiElement);
m_scrollRightClickEventToken = m_scrollRight->Click += ref new RoutedEventHandler(this, &OverflowTextBlock::OnScrollClick);
}
m_scrollingLeft = false;
m_scrollingRight = false;
auto borderContainer = safe_cast<Border^>(GetTemplateChild("expressionborder"));
m_pointerEnteredEventToken = borderContainer->PointerEntered += ref new PointerEventHandler(this, &OverflowTextBlock::OnPointerEntered);
m_pointerExitedEventToken = borderContainer->PointerExited += ref new PointerEventHandler(this, &OverflowTextBlock::OnPointerExited);
m_listView = safe_cast<ListView^>(GetTemplateChild("TokenList"));
uiElement = GetTemplateChild("TokenList");
if (uiElement != nullptr)
{
m_itemsControl = safe_cast<ItemsControl ^>(uiElement);
}
UpdateAllState();
}
AutomationPeer^ OverflowTextBlock::OnCreateAutomationPeer()
AutomationPeer ^ OverflowTextBlock::OnCreateAutomationPeer()
{
return ref new OverflowTextBlockAutomationPeer(this);
}
void OverflowTextBlock::OnTokensUpdatedPropertyChanged(bool /*oldValue*/, bool newValue)
{
if ((m_listView != nullptr) && (newValue))
if (m_expressionContainer != nullptr && newValue)
{
unsigned int tokenCount = m_listView->Items->Size;
if (tokenCount > 0)
{
m_listView->UpdateLayout();
m_listView->ScrollIntoView(m_listView->Items->GetAt(tokenCount - 1));
m_expressionContainer->ChangeView(m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth, nullptr, nullptr);
}
m_expressionContainer->UpdateLayout();
m_expressionContainer->ChangeView(m_expressionContainer->ScrollableWidth, nullptr, nullptr, true);
}
AutomationProperties::SetAccessibilityView(this,
m_listView != nullptr && m_listView->Items->Size > 0 ? AccessibilityView::Control : AccessibilityView::Raw);
auto newIsAccessibilityViewControl = m_itemsControl != nullptr && m_itemsControl->Items->Size > 0;
if (m_isAccessibilityViewControl != newIsAccessibilityViewControl)
{
m_isAccessibilityViewControl = newIsAccessibilityViewControl;
AutomationProperties::SetAccessibilityView(this, newIsAccessibilityViewControl ? AccessibilityView::Control : AccessibilityView::Raw);
}
UpdateScrollButtons();
}
void OverflowTextBlock::UpdateAllState()
@@ -93,7 +107,7 @@ void OverflowTextBlock::UpdateVisualState()
void OverflowTextBlock::ScrollLeft()
{
if (m_expressionContainer->HorizontalOffset > 0)
if (m_expressionContainer != nullptr && m_expressionContainer->HorizontalOffset > 0)
{
m_scrollingLeft = true;
double offset = m_expressionContainer->HorizontalOffset - (scrollRatio * m_expressionContainer->ViewportWidth);
@@ -105,7 +119,7 @@ void OverflowTextBlock::ScrollLeft()
void OverflowTextBlock::ScrollRight()
{
if (m_expressionContainer->HorizontalOffset < m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth)
if (m_expressionContainer != nullptr && m_expressionContainer->HorizontalOffset < m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth)
{
m_scrollingRight = true;
double offset = m_expressionContainer->HorizontalOffset + (scrollRatio * m_expressionContainer->ViewportWidth);
@@ -115,9 +129,9 @@ void OverflowTextBlock::ScrollRight()
}
}
void OverflowTextBlock::OnScrollClick(_In_ Object^ sender, _In_ RoutedEventArgs^)
void OverflowTextBlock::OnScrollClick(_In_ Object ^ sender, _In_ RoutedEventArgs ^)
{
auto clicked = safe_cast<Button^>(sender);
auto clicked = safe_cast<Button ^>(sender);
if (clicked == m_scrollLeft)
{
ScrollLeft();
@@ -128,31 +142,22 @@ void OverflowTextBlock::OnScrollClick(_In_ Object^ sender, _In_ RoutedEventArgs^
}
}
void OverflowTextBlock::OnPointerEntered(_In_ Object^, _In_ PointerRoutedEventArgs^ e)
{
if (e->Pointer->PointerDeviceType == PointerDeviceType::Mouse)
{
UpdateScrollButtons();
}
}
void OverflowTextBlock::OnPointerExited(_In_ Object^, _In_ PointerRoutedEventArgs^ e)
{
if (e->Pointer->PointerDeviceType == PointerDeviceType::Mouse)
{
UpdateScrollButtons();
}
}
void OverflowTextBlock::UpdateScrollButtons()
{
if (m_itemsControl == nullptr || m_expressionContainer == nullptr)
{
return;
}
// When the width is smaller than the container, don't show any
if (m_listView->ActualWidth <= m_expressionContainer->ActualWidth)
if (m_itemsControl->ActualWidth <= m_expressionContainer->ActualWidth)
{
ShowHideScrollButtons(::Visibility::Collapsed, ::Visibility::Collapsed);
}
// We have more number on both side. Show both arrows
else if ((m_expressionContainer->HorizontalOffset > 0) && (m_expressionContainer->HorizontalOffset < (m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth)))
else if (
(m_expressionContainer->HorizontalOffset > 0)
&& (m_expressionContainer->HorizontalOffset < (m_expressionContainer->ExtentWidth - m_expressionContainer->ViewportWidth)))
{
ShowHideScrollButtons(::Visibility::Visible, ::Visibility::Visible);
}
@@ -163,7 +168,10 @@ void OverflowTextBlock::UpdateScrollButtons()
if (m_scrollingLeft)
{
m_scrollingLeft = false;
m_scrollRight->Focus(::FocusState::Programmatic);
if (m_scrollRight != nullptr)
{
m_scrollRight->Focus(::FocusState::Programmatic);
}
}
}
else // Width is larger than the container and right most part of the number is shown. Should be able to scroll left.
@@ -172,7 +180,10 @@ void OverflowTextBlock::UpdateScrollButtons()
if (m_scrollingRight)
{
m_scrollingRight = false;
m_scrollLeft->Focus(::FocusState::Programmatic);
if (m_scrollLeft != nullptr)
{
m_scrollLeft->Focus(::FocusState::Programmatic);
}
}
}
}
@@ -199,12 +210,13 @@ void OverflowTextBlock::UnregisterEventHandlers()
m_scrollRight->Click -= m_scrollRightClickEventToken;
}
auto borderContainer = safe_cast<Border^>(GetTemplateChild("expressionborder"));
// Adding an extra check, in case the returned template is null
if (borderContainer != nullptr)
if (m_expressionContainer != nullptr)
{
borderContainer->PointerEntered -= m_pointerEnteredEventToken;
borderContainer->PointerExited -= m_pointerExitedEventToken;
m_expressionContainer->ViewChanged -= m_containerViewChangedToken;
}
}
void OverflowTextBlock::OnViewChanged(_In_opt_ Object ^ /*sender*/, _In_opt_ ScrollViewerViewChangedEventArgs ^ /*args*/)
{
UpdateScrollButtons();
}

View File

@@ -9,7 +9,8 @@ namespace CalculatorApp
{
namespace Controls
{
public ref class OverflowTextBlock sealed : public Windows::UI::Xaml::Controls::Control
public
ref class OverflowTextBlock sealed : public Windows::UI::Xaml::Controls::Control
{
public:
OverflowTextBlock()
@@ -20,20 +21,21 @@ namespace CalculatorApp
DEPENDENCY_PROPERTY_WITH_CALLBACK(bool, TokensUpdated);
DEPENDENCY_PROPERTY(bool, IsActive);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Style^, TextStyle);
DEPENDENCY_PROPERTY(Windows::UI::Xaml::Style ^, TextStyle);
void UpdateScrollButtons();
void UnregisterEventHandlers();
protected:
virtual void OnApplyTemplate() override;
virtual Windows::UI::Xaml::Automation::Peers::AutomationPeer^ OnCreateAutomationPeer() override;
virtual Windows::UI::Xaml::Automation::Peers::AutomationPeer ^ OnCreateAutomationPeer() override;
private:
void OnScrollClick(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs^ e);
void OnPointerEntered(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
void OnPointerExited(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e);
void OnScrollClick(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void OnPointerEntered(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e);
void OnPointerExited(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::Input::PointerRoutedEventArgs ^ e);
void ShowHideScrollButtons(Windows::UI::Xaml::Visibility vLeft, Windows::UI::Xaml::Visibility vRight);
void OnTokensUpdatedPropertyChanged(bool oldValue, bool newValue);
void OnViewChanged(_In_opt_ Platform::Object ^ sender, _In_opt_ Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs ^ args);
void UpdateVisualState();
void UpdateExpressionState();
@@ -44,15 +46,15 @@ namespace CalculatorApp
double scrollRatio = 0.7;
bool m_scrollingLeft;
bool m_scrollingRight;
Windows::UI::Xaml::Controls::ListView^ m_listView;
Windows::UI::Xaml::Controls::ScrollViewer^ m_expressionContainer;
Windows::UI::Xaml::Controls::Button^ m_scrollLeft;
Windows::UI::Xaml::Controls::Button^ m_scrollRight;
bool m_isAccessibilityViewControl;
Windows::UI::Xaml::Controls::ItemsControl ^ m_itemsControl;
Windows::UI::Xaml::Controls::ScrollViewer ^ m_expressionContainer;
Windows::UI::Xaml::Controls::Button ^ m_scrollLeft;
Windows::UI::Xaml::Controls::Button ^ m_scrollRight;
Windows::Foundation::EventRegistrationToken m_scrollLeftClickEventToken;
Windows::Foundation::EventRegistrationToken m_scrollRightClickEventToken;
Windows::Foundation::EventRegistrationToken m_pointerEnteredEventToken;
Windows::Foundation::EventRegistrationToken m_pointerExitedEventToken;
Windows::Foundation::EventRegistrationToken m_containerViewChangedToken;
};
}
}

View File

@@ -10,16 +10,17 @@ using namespace Windows::Foundation::Collections;
namespace CalculatorApp::Controls
{
OverflowTextBlockAutomationPeer::OverflowTextBlockAutomationPeer(OverflowTextBlock^ owner) :
FrameworkElementAutomationPeer(owner)
{ }
OverflowTextBlockAutomationPeer::OverflowTextBlockAutomationPeer(OverflowTextBlock ^ owner)
: FrameworkElementAutomationPeer(owner)
{
}
AutomationControlType OverflowTextBlockAutomationPeer::GetAutomationControlTypeCore()
{
return AutomationControlType::Text;
}
IVector<AutomationPeer^>^ OverflowTextBlockAutomationPeer::GetChildrenCore()
IVector<AutomationPeer ^> ^ OverflowTextBlockAutomationPeer::GetChildrenCore()
{
return nullptr;
}

View File

@@ -9,13 +9,14 @@ namespace CalculatorApp
{
namespace Controls
{
public ref class OverflowTextBlockAutomationPeer sealed : Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer
public
ref class OverflowTextBlockAutomationPeer sealed : Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer
{
public:
OverflowTextBlockAutomationPeer(OverflowTextBlock^ owner);
OverflowTextBlockAutomationPeer(OverflowTextBlock ^ owner);
virtual Windows::UI::Xaml::Automation::Peers::AutomationControlType GetAutomationControlTypeCore() override;
virtual Windows::Foundation::Collections::IVector<Windows::UI::Xaml::Automation::Peers::AutomationPeer^>^ GetChildrenCore() override;
virtual Windows::Foundation::Collections::IVector<Windows::UI::Xaml::Automation::Peers::AutomationPeer ^> ^ GetChildrenCore() override;
};
}
}

View File

@@ -16,10 +16,10 @@ using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Data;
String^ RadixButton::GetRawDisplayValue()
String ^ RadixButton::GetRawDisplayValue()
{
wstring rawValue;
String^ radixContent = Content->ToString();
String ^ radixContent = Content->ToString();
LocalizationSettings::GetInstance().RemoveGroupSeparators(radixContent->Data(), radixContent->Length(), &rawValue);
return ref new String(rawValue.c_str());
}

View File

@@ -7,12 +7,12 @@ namespace CalculatorApp
{
namespace Controls
{
public ref class RadixButton sealed : public Windows::UI::Xaml::Controls::RadioButton
public
ref class RadixButton sealed : public Windows::UI::Xaml::Controls::RadioButton
{
public:
RadixButton() {};
internal:
Platform::String^ GetRawDisplayValue();
RadixButton(){};
internal : Platform::String ^ GetRawDisplayValue();
};
}
}

View File

@@ -18,23 +18,23 @@ using namespace Platform;
using namespace Windows::Foundation::Collections;
using namespace std;
DependencyObject^ SupplementaryItemsControl::GetContainerForItemOverride()
DependencyObject ^ SupplementaryItemsControl::GetContainerForItemOverride()
{
return ref new SupplementaryContentPresenter();
}
void SupplementaryItemsControl::PrepareContainerForItemOverride(DependencyObject^ element, Object^ item)
void SupplementaryItemsControl::PrepareContainerForItemOverride(DependencyObject ^ element, Object ^ item)
{
ItemsControl::PrepareContainerForItemOverride(element, item);
auto supplementaryResult = dynamic_cast<SupplementaryResult^>(item);
auto supplementaryResult = dynamic_cast<SupplementaryResult ^>(item);
if (supplementaryResult)
{
AutomationProperties::SetName(element, supplementaryResult->GetLocalizedAutomationName());
}
}
AutomationPeer^ SupplementaryContentPresenter::OnCreateAutomationPeer()
{
return ref new SupplementaryContentPresenterAP(this);
}
AutomationPeer ^ SupplementaryContentPresenter::OnCreateAutomationPeer()
{
return ref new SupplementaryContentPresenterAP(this);
}

View File

@@ -3,45 +3,52 @@
#pragma once
namespace CalculatorApp { namespace Controls {
public ref class SupplementaryItemsControl sealed: public Windows::UI::Xaml::Controls::ItemsControl
namespace CalculatorApp
{
namespace Controls
{
public:
SupplementaryItemsControl()
{ }
protected:
virtual Windows::UI::Xaml::DependencyObject^ GetContainerForItemOverride() override;
virtual void PrepareContainerForItemOverride(Windows::UI::Xaml::DependencyObject^ element, Platform::Object^ item) override;
};
public ref class SupplementaryContentPresenter sealed: public Windows::UI::Xaml::Controls::ContentPresenter
{
public:
SupplementaryContentPresenter()
{ }
protected:
virtual Windows::UI::Xaml::Automation::Peers::AutomationPeer^ OnCreateAutomationPeer() override;
};
ref class SupplementaryContentPresenterAP sealed: public Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer
{
protected:
virtual Windows::UI::Xaml::Automation::Peers::AutomationControlType GetAutomationControlTypeCore() override
public
ref class SupplementaryItemsControl sealed : public Windows::UI::Xaml::Controls::ItemsControl
{
return Windows::UI::Xaml::Automation::Peers::AutomationControlType::Text;
}
public:
SupplementaryItemsControl()
{
}
virtual Windows::Foundation::Collections::IVector<Windows::UI::Xaml::Automation::Peers::AutomationPeer^>^ GetChildrenCore() override
protected:
virtual Windows::UI::Xaml::DependencyObject ^ GetContainerForItemOverride() override;
virtual void PrepareContainerForItemOverride(Windows::UI::Xaml::DependencyObject ^ element, Platform::Object ^ item) override;
};
public
ref class SupplementaryContentPresenter sealed : public Windows::UI::Xaml::Controls::ContentPresenter
{
return nullptr;
}
public:
SupplementaryContentPresenter()
{
}
internal:
SupplementaryContentPresenterAP(SupplementaryContentPresenter^ owner):
Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer(owner)
{ }
};
}}
protected:
virtual Windows::UI::Xaml::Automation::Peers::AutomationPeer ^ OnCreateAutomationPeer() override;
};
ref class SupplementaryContentPresenterAP sealed : public Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer
{
protected:
virtual Windows::UI::Xaml::Automation::Peers::AutomationControlType GetAutomationControlTypeCore() override
{
return Windows::UI::Xaml::Automation::Peers::AutomationControlType::Text;
}
virtual Windows::Foundation::Collections::IVector<Windows::UI::Xaml::Automation::Peers::AutomationPeer ^> ^ GetChildrenCore() override
{
return nullptr;
}
internal : SupplementaryContentPresenterAP(SupplementaryContentPresenter ^ owner)
: Windows::UI::Xaml::Automation::Peers::FrameworkElementAutomationPeer(owner)
{
}
};
}
}

View File

@@ -15,7 +15,7 @@ using namespace Windows::Foundation;
using namespace Windows::UI::Xaml::Interop;
// returns automationName in form "Nth bit Value zero/one" depending if bit is set/unset at corresponding index of binary display
Object^ BitFlipAutomationNameConverter::Convert(_In_ Object^ value, TypeName targetType, _In_ Object^ parameter, _In_ String^ language)
Object ^ BitFlipAutomationNameConverter::Convert(_In_ Object ^ value, TypeName targetType, _In_ Object ^ parameter, _In_ String ^ language)
{
auto resourceLoader = AppResourceProvider::GetInstance();
@@ -26,15 +26,15 @@ Object^ BitFlipAutomationNameConverter::Convert(_In_ Object^ value, TypeName tar
wchar_t ch0 = localizationSettings.GetDigitSymbolFromEnUsDigit('0');
wchar_t ch1 = localizationSettings.GetDigitSymbolFromEnUsDigit('1');
String^ indexName = resourceLoader.GetResourceString(static_cast<String^>(parameter));
String^ bitName = resourceLoader.GetResourceString(L"BitAutomationName");
String^ valueName = resourceLoader.GetResourceString(L"ValueAutomationName");
String^ zero = resourceLoader.GetResourceString(L"BinaryZeroValueAutomationName");
String^ one = resourceLoader.GetResourceString(L"BinaryOneValueAutomationName");
String ^ indexName = resourceLoader.GetResourceString(static_cast<String ^>(parameter));
String ^ bitName = resourceLoader.GetResourceString(L"BitAutomationName");
String ^ valueName = resourceLoader.GetResourceString(L"ValueAutomationName");
String ^ zero = resourceLoader.GetResourceString(L"BinaryZeroValueAutomationName");
String ^ one = resourceLoader.GetResourceString(L"BinaryOneValueAutomationName");
if ((value != nullptr) && (parameter != nullptr))
{
wstring binaryDisplay = (static_cast<String^>(value))->Data();
wstring indexString = (static_cast<String^>(parameter))->Data();
wstring binaryDisplay = (static_cast<String ^>(value))->Data();
wstring indexString = (static_cast<String ^>(parameter))->Data();
wstringstream converter;
converter << indexString;
unsigned int index;
@@ -42,7 +42,7 @@ Object^ BitFlipAutomationNameConverter::Convert(_In_ Object^ value, TypeName tar
unsigned int binaryLength = 0;
// remove all the characters except 0 and 1 from the array.
for each (wchar_t bit in binaryDisplay)
for (wchar_t bit : binaryDisplay)
{
if ((bit == ch1) || (bit == ch0))
{
@@ -74,7 +74,7 @@ Object^ BitFlipAutomationNameConverter::Convert(_In_ Object^ value, TypeName tar
return (indexName + bitName + valueName + zero);
}
Object^ BitFlipAutomationNameConverter::ConvertBack(_In_ Object^ value, TypeName targetType, _In_ Object^ parameter, _In_ String^ language)
Object ^ BitFlipAutomationNameConverter::ConvertBack(_In_ Object ^ value, TypeName targetType, _In_ Object ^ parameter, _In_ String ^ language)
{
return value;
}

View File

@@ -10,13 +10,21 @@ namespace CalculatorApp
/// <summary>
/// Value converter that translates binary value to automation name for a bit.
/// </summary>
[Windows::Foundation::Metadata::WebHostHidden]
public ref class BitFlipAutomationNameConverter sealed : Windows::UI::Xaml::Data::IValueConverter
[Windows::Foundation::Metadata::WebHostHidden] public ref class BitFlipAutomationNameConverter sealed : Windows::UI::Xaml::Data::IValueConverter
{
public:
virtual Platform::Object^ Convert(_In_ Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, _In_ Platform::Object^ parameter, _In_ Platform::String^ language);
virtual Platform::Object^ ConvertBack(_In_ Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, _In_ Platform::Object^ parameter, _In_ Platform::String^ language);
virtual Platform::Object
^ Convert(
_In_ Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
_In_ Platform::Object ^ parameter,
_In_ Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(
_In_ Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
_In_ Platform::Object ^ parameter,
_In_ Platform::String ^ language);
};
}
}

View File

@@ -10,24 +10,24 @@ using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::UI::Xaml::Interop;
Object^ BooleanNegationConverter::Convert(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ BooleanNegationConverter::Convert(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
(void) targetType; // Unused parameter
(void) parameter; // Unused parameter
(void) language; // Unused parameter
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
auto boxedBool = dynamic_cast<Box<bool>^>(value);
auto boxedBool = dynamic_cast<Box<bool> ^>(value);
auto boolValue = (boxedBool != nullptr && boxedBool->Value);
return !boolValue;
}
Object^ BooleanNegationConverter::ConvertBack(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ BooleanNegationConverter::ConvertBack(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
(void) targetType; // Unused parameter
(void) parameter; // Unused parameter
(void) language; // Unused parameter
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
auto boxedBool = dynamic_cast<Box<bool>^>(value);
auto boxedBool = dynamic_cast<Box<bool> ^>(value);
auto boolValue = (boxedBool != nullptr && boxedBool->Value);
return !boolValue;
}

View File

@@ -10,12 +10,17 @@ namespace CalculatorApp
/// <summary>
/// Value converter that translates true to false and vice versa.
/// </summary>
[Windows::Foundation::Metadata::WebHostHidden]
public ref class BooleanNegationConverter sealed : Windows::UI::Xaml::Data::IValueConverter
[Windows::Foundation::Metadata::WebHostHidden] public ref class BooleanNegationConverter sealed : Windows::UI::Xaml::Data::IValueConverter
{
public:
virtual Platform::Object^ Convert(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object^ ConvertBack(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}
}

View File

@@ -15,45 +15,45 @@ namespace CalculatorApp
{
namespace Converters
{
Object^ BooleanToVisibilityConverter::Convert(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ BooleanToVisibilityConverter::Convert(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
(void) targetType; // Unused parameter
(void) parameter; // Unused parameter
(void) language; // Unused parameter
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
auto boxedBool = dynamic_cast<Box<bool>^>(value);
auto boxedBool = dynamic_cast<Box<bool> ^>(value);
auto boolValue = (boxedBool != nullptr && boxedBool->Value);
return BooleanToVisibilityConverter::Convert(boolValue);
}
Object^ BooleanToVisibilityConverter::ConvertBack(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ BooleanToVisibilityConverter::ConvertBack(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
(void) targetType; // Unused parameter
(void) parameter; // Unused parameter
(void) language; // Unused parameter
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
auto visibility = dynamic_cast<Box<Visibility>^>(value);
auto visibility = dynamic_cast<Box<Visibility> ^>(value);
return (visibility != nullptr && visibility->Value == Visibility::Visible);
}
Object^ BooleanToVisibilityNegationConverter::Convert(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ BooleanToVisibilityNegationConverter::Convert(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
(void) targetType; // Unused parameter
(void) parameter; // Unused parameter
(void) language; // Unused parameter
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
auto boxedBool = dynamic_cast<Box<bool>^>(value);
auto boxedBool = dynamic_cast<Box<bool> ^>(value);
auto boolValue = (boxedBool != nullptr && boxedBool->Value);
return BooleanToVisibilityConverter::Convert(!boolValue);
}
Object^ BooleanToVisibilityNegationConverter::ConvertBack(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ BooleanToVisibilityNegationConverter::ConvertBack(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
(void) targetType; // Unused parameter
(void) parameter; // Unused parameter
(void) language; // Unused parameter
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
auto visibility = dynamic_cast<Box<Visibility>^>(value);
auto visibility = dynamic_cast<Box<Visibility> ^>(value);
return (visibility != nullptr && visibility->Value != Visibility::Visible);
}

View File

@@ -11,29 +11,41 @@ namespace CalculatorApp
/// Value converter that translates true to <see cref="Visibility::Visible"/> and false
/// to <see cref="Visibility::Collapsed"/>.
/// </summary>
public ref class BooleanToVisibilityConverter sealed : Windows::UI::Xaml::Data::IValueConverter
public
ref class BooleanToVisibilityConverter sealed : Windows::UI::Xaml::Data::IValueConverter
{
public:
static constexpr Windows::UI::Xaml::Visibility Convert(bool visibility)
{
return visibility
? Windows::UI::Xaml::Visibility::Visible
: Windows::UI::Xaml::Visibility::Collapsed;
return visibility ? Windows::UI::Xaml::Visibility::Visible : Windows::UI::Xaml::Visibility::Collapsed;
}
virtual Platform::Object^ Convert(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object^ ConvertBack(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
/// <summary>
/// Value converter that translates false to <see cref="Visibility::Visible"/> and true
/// to <see cref="Visibility::Collapsed"/>.
/// </summary>
public ref class BooleanToVisibilityNegationConverter sealed : Windows::UI::Xaml::Data::IValueConverter
public
ref class BooleanToVisibilityNegationConverter sealed : Windows::UI::Xaml::Data::IValueConverter
{
public:
virtual Platform::Object^ Convert(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object^ ConvertBack(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}

View File

@@ -1,44 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "ExpressionItemContainerStyle.h"
#include "CalcViewModel/Common/DisplayExpressionToken.h"
using namespace CalculatorApp::Common;
namespace CalculatorApp
{
namespace Converters
{
Windows::UI::Xaml::Style^ ExpressionItemContainerStyle::SelectStyleCore(Platform::Object^ item, Windows::UI::Xaml::DependencyObject^ container)
{
DisplayExpressionToken^ token = dynamic_cast<DisplayExpressionToken^>(item);
if (token != nullptr)
{
Common::TokenType type = token->Type;
switch (type)
{
case TokenType::Operator:
if (token->IsTokenEditable)
{
return m_editableOperatorStyle;
}
else
{
return m_nonEditableOperatorStyle;
}
case TokenType::Operand:
return m_operandStyle;
case TokenType::Separator:
return m_separatorStyle;
default:
throw ref new Platform::Exception(E_FAIL, L"Invalid token type");
}
}
return m_separatorStyle;
}
}
}

View File

@@ -1,71 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
namespace CalculatorApp
{
namespace Converters
{
[Windows::UI::Xaml::Data::Bindable]
public ref class ExpressionItemContainerStyle sealed : public Windows::UI::Xaml::Controls::StyleSelector
{
public:
virtual Windows::UI::Xaml::Style^ SelectStyleCore(Platform::Object^ item, Windows::UI::Xaml::DependencyObject^ container) override;
property Windows::UI::Xaml::Style^ EditableOperatorStyle
{
Windows::UI::Xaml::Style^ get()
{
return m_editableOperatorStyle;
}
void set(Windows::UI::Xaml::Style^ val)
{
m_editableOperatorStyle = val;
}
}
property Windows::UI::Xaml::Style^ OperandStyle
{
Windows::UI::Xaml::Style^ get()
{
return m_operandStyle;
}
void set(Windows::UI::Xaml::Style^ val)
{
m_operandStyle = val;
}
}
property Windows::UI::Xaml::Style^ SeparatorStyle
{
Windows::UI::Xaml::Style^ get()
{
return m_separatorStyle;
}
void set(Windows::UI::Xaml::Style^ val)
{
m_separatorStyle = val;
}
}
property Windows::UI::Xaml::Style^ NonEditableOperatorStyle
{
Windows::UI::Xaml::Style^ get()
{
return m_nonEditableOperatorStyle;
}
void set(Windows::UI::Xaml::Style^ val)
{
m_nonEditableOperatorStyle = val;
}
}
private:
Windows::UI::Xaml::Style^ m_editableOperatorStyle;
Windows::UI::Xaml::Style^ m_nonEditableOperatorStyle;
Windows::UI::Xaml::Style^ m_operandStyle;
Windows::UI::Xaml::Style^ m_separatorStyle;
};
}
}

View File

@@ -11,9 +11,10 @@ namespace CalculatorApp
{
namespace Converters
{
Windows::UI::Xaml::DataTemplate^ ExpressionItemTemplateSelector::SelectTemplateCore(Platform::Object^ item, Windows::UI::Xaml::DependencyObject^ container)
Windows::UI::Xaml::DataTemplate
^ ExpressionItemTemplateSelector::SelectTemplateCore(Platform::Object ^ item, Windows::UI::Xaml::DependencyObject ^ container)
{
DisplayExpressionToken^ token = dynamic_cast<DisplayExpressionToken^>(item);
DisplayExpressionToken ^ token = dynamic_cast<DisplayExpressionToken ^>(item);
if (token != nullptr)
{
Common::TokenType type = token->Type;

View File

@@ -7,11 +7,10 @@ namespace CalculatorApp
{
namespace Converters
{
[Windows::UI::Xaml::Data::Bindable]
public ref class ExpressionItemTemplateSelector sealed : public Windows::UI::Xaml::Controls::DataTemplateSelector
[Windows::UI::Xaml::Data::Bindable] public ref class ExpressionItemTemplateSelector sealed : public Windows::UI::Xaml::Controls::DataTemplateSelector
{
public:
virtual Windows::UI::Xaml::DataTemplate^ SelectTemplateCore(Platform::Object^ item, Windows::UI::Xaml::DependencyObject^ container) override;
virtual Windows::UI::Xaml::DataTemplate ^ SelectTemplateCore(Platform::Object ^ item, Windows::UI::Xaml::DependencyObject ^ container) override;
property Windows::UI::Xaml::DataTemplate^ OperatorTemplate
{
@@ -51,8 +50,8 @@ namespace CalculatorApp
private:
Windows::UI::Xaml::DataTemplate^ m_operatorTemplate;
Windows::UI::Xaml::DataTemplate^ m_operandTemplate;
Windows::UI::Xaml::DataTemplate^ m_separatorTemplate;
Windows::UI::Xaml::DataTemplate ^ m_operandTemplate;
Windows::UI::Xaml::DataTemplate ^ m_separatorTemplate;
};
}
}

View File

@@ -11,34 +11,34 @@ using namespace Windows::Foundation;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Interop;
Object^ ItemSizeToVisibilityConverter::Convert(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ ItemSizeToVisibilityConverter::Convert(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
(void) targetType; // Unused parameter
(void) parameter; // Unused parameter
(void) language; // Unused parameter
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
auto items = dynamic_cast<Box<int>^>(value);
auto items = dynamic_cast<Box<int> ^>(value);
auto boolValue = (items != nullptr && (items->Value == 0));
return BooleanToVisibilityConverter::Convert(boolValue);
}
Object^ ItemSizeToVisibilityConverter::ConvertBack(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ ItemSizeToVisibilityConverter::ConvertBack(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
throw ref new NotImplementedException();
}
Object^ ItemSizeToVisibilityNegationConverter::Convert(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ ItemSizeToVisibilityNegationConverter::Convert(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
(void) targetType; // Unused parameter
(void) parameter; // Unused parameter
(void) language; // Unused parameter
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
auto items = dynamic_cast<Box<int>^>(value);
auto items = dynamic_cast<Box<int> ^>(value);
auto boolValue = (items != nullptr && (items->Value > 0));
return BooleanToVisibilityConverter::Convert(boolValue);
}
Object^ ItemSizeToVisibilityNegationConverter::ConvertBack(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ ItemSizeToVisibilityNegationConverter::ConvertBack(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
throw ref new NotImplementedException();
}

View File

@@ -7,19 +7,31 @@ namespace CalculatorApp
{
namespace Converters
{
[Windows::Foundation::Metadata::WebHostHidden]
public ref class ItemSizeToVisibilityConverter sealed : Windows::UI::Xaml::Data::IValueConverter
[Windows::Foundation::Metadata::WebHostHidden] public ref class ItemSizeToVisibilityConverter sealed : Windows::UI::Xaml::Data::IValueConverter
{
public:
virtual Platform::Object^ Convert(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object^ ConvertBack(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
public ref class ItemSizeToVisibilityNegationConverter sealed : Windows::UI::Xaml::Data::IValueConverter
public
ref class ItemSizeToVisibilityNegationConverter sealed : Windows::UI::Xaml::Data::IValueConverter
{
public:
virtual Platform::Object^ Convert(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object^ ConvertBack(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}
}

View File

@@ -15,14 +15,14 @@ namespace CalculatorApp
{
namespace Converters
{
Object^ RadixToStringConverter::Convert(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ RadixToStringConverter::Convert(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
(void)targetType; // Unused parameter
(void)parameter; // Unused parameter
(void)language; // Unused parameter
auto boxedInt = dynamic_cast<Box<int>^>(value);
Platform::String^ convertedValue;
auto boxedInt = dynamic_cast<Box<int> ^>(value);
Platform::String ^ convertedValue;
auto resourceLoader = AppResourceProvider::GetInstance();
switch (boxedInt->Value)
{
@@ -48,14 +48,11 @@ namespace CalculatorApp
}
default:
break;
};
return convertedValue;
}
Object^ RadixToStringConverter::ConvertBack(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ RadixToStringConverter::ConvertBack(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
throw ref new NotImplementedException();
}

View File

@@ -10,12 +10,17 @@ namespace CalculatorApp
/// <summary>
/// Value converter that translates true to false and vice versa.
/// </summary>
[Windows::Foundation::Metadata::WebHostHidden]
public ref class RadixToStringConverter sealed : Windows::UI::Xaml::Data::IValueConverter
[Windows::Foundation::Metadata::WebHostHidden] public ref class RadixToStringConverter sealed : Windows::UI::Xaml::Data::IValueConverter
{
public:
virtual Platform::Object^ Convert(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object^ ConvertBack(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}
}

View File

@@ -13,9 +13,9 @@ namespace CalculatorApp
{
namespace Common
{
Object^ VisibilityNegationConverter::Convert(Object^ value, TypeName /*targetType*/, Object^ /*parameter*/, String^ /*language*/)
Object ^ VisibilityNegationConverter::Convert(Object ^ value, TypeName /*targetType*/, Object ^ /*parameter*/, String ^ /*language*/)
{
auto boxedVisibility = dynamic_cast<Box<Visibility>^>(value);
auto boxedVisibility = dynamic_cast<Box<Visibility> ^>(value);
Visibility visibility = Visibility::Collapsed;
if (boxedVisibility != nullptr && boxedVisibility->Value == Visibility::Collapsed)
{
@@ -24,7 +24,7 @@ namespace CalculatorApp
return visibility;
}
Object^ VisibilityNegationConverter::ConvertBack(Object^ value, TypeName targetType, Object^ parameter, String^ language)
Object ^ VisibilityNegationConverter::ConvertBack(Object ^ value, TypeName targetType, Object ^ parameter, String ^ language)
{
return Convert(value, targetType, parameter, language);
}

View File

@@ -10,12 +10,17 @@ namespace CalculatorApp
/// <summary>
/// Value converter that translates Visible to Collapsed and vice versa
/// </summary>
[Windows::Foundation::Metadata::WebHostHidden]
public ref class VisibilityNegationConverter sealed : Windows::UI::Xaml::Data::IValueConverter
[Windows::Foundation::Metadata::WebHostHidden] public ref class VisibilityNegationConverter sealed : Windows::UI::Xaml::Data::IValueConverter
{
public:
virtual Platform::Object^ Convert(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object^ ConvertBack(Platform::Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object^ parameter, Platform::String^ language);
virtual Platform::Object
^ Convert(Platform::Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Platform::Object ^ parameter, Platform::String ^ language);
virtual Platform::Object
^ ConvertBack(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName targetType,
Platform::Object ^ parameter,
Platform::String ^ language);
};
}
}

View File

@@ -13,30 +13,30 @@ namespace Numbers
#ifdef _DEBUG
// These class are to be consumed exclusively by Blend and the VS designer
// with these classes Blend will be able to populate the controls
// with the hardcoded strings so whoever is working on the UI can actually see how the app would look like
// with the hardcoded strings so whoever is working on the UI can actually see how the app would look like
// with semi-realistic data.
// This data is to only be compiled in the debug build and it will not affect app functionality at all
// This data is to only be compiled in the debug build and it will not affect app functionality at all
// so it does not need to be tested. It will have to be kept in sync with UnitConverterViewModel though
// to ensure that the design experience is correct.
// This class's code is run in the designer process so the less code it has the better.
// This class's code is run in the designer process so the less code it has the better.
public ref class AppViewModel sealed: public Windows::UI::Xaml::Data::INotifyPropertyChanged
public
ref class AppViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
AppViewModel() :
m_IsStandardMode(true),
m_IsScientificMode(false),
m_IsConverterMode(false),
m_CalculatorViewModel(ref new StandardCalculatorViewModel()),
m_ConverterViewModel(ref new UnitConverterViewModel())
{}
AppViewModel()
: m_IsStandardMode(true)
, m_IsScientificMode(false)
, m_IsConverterMode(false)
, m_CalculatorViewModel(ref new StandardCalculatorViewModel())
, m_ConverterViewModel(ref new UnitConverterViewModel())
{
}
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_RW(StandardCalculatorViewModel^, CalculatorViewModel);
OBSERVABLE_PROPERTY_RW(UnitConverterViewModel^, ConverterViewModel);
OBSERVABLE_PROPERTY_RW(StandardCalculatorViewModel ^, CalculatorViewModel);
OBSERVABLE_PROPERTY_RW(UnitConverterViewModel ^, ConverterViewModel);
OBSERVABLE_PROPERTY_RW(bool, IsStandardMode);
OBSERVABLE_PROPERTY_RW(bool, IsScientificMode);
OBSERVABLE_PROPERTY_RW(bool, IsConverterMode);

View File

@@ -9,38 +9,40 @@ namespace Numbers
{
#ifdef _DEBUG
public ref class MemorySlot sealed: public Windows::UI::Xaml::Data::INotifyPropertyChanged
public
ref class MemorySlot sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
MemorySlot(int slotPosition, Platform::String^ value) :
m_SlotPosition(slotPosition),
m_SlotValue(value)
{}
MemorySlot(int slotPosition, Platform::String ^ value)
: m_SlotPosition(slotPosition)
, m_SlotValue(value)
{
}
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_RW(int, SlotPosition);
OBSERVABLE_PROPERTY_RW(Platform::String^, SlotValue);
OBSERVABLE_PROPERTY_RW(Platform::String ^, SlotValue);
};
// This class is to be consumed exclusively by Blend and the VS designer
// with this class Blend will be able to populate the controls, the CalculationResults control for example,
// with the hardcoded strings so whoever is working on the UI can actually see how the app would look like
// with the hardcoded strings so whoever is working on the UI can actually see how the app would look like
// with semi-realistic data.
// This data is to only be compiled in the debug build and it will not affect app functionality at all
// This data is to only be compiled in the debug build and it will not affect app functionality at all
// so it does not need to be tested. It will have to be kept in sync with StandardCalculatorViewModel though
// to ensure that the design experience is correct.
// This class's code is run in the designer process so the less code it has the better.
public ref class StandardCalculatorViewModel sealed: public Windows::UI::Xaml::Data::INotifyPropertyChanged
// This class's code is run in the designer process so the less code it has the better.
public
ref class StandardCalculatorViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
StandardCalculatorViewModel():
m_DisplayValue("1234569"),
m_DisplayStringExpression("14560 x 1890"),
m_DegreeButtonContent("Deg"),
m_IsMemoryEmpty(false)
StandardCalculatorViewModel()
: m_DisplayValue("1234569")
, m_DisplayStringExpression("14560 x 1890")
, m_DegreeButtonContent("Deg")
, m_IsMemoryEmpty(false)
{
m_MemorizedNumbers = ref new Platform::Collections::Vector<MemorySlot^>();
m_MemorizedNumbers = ref new Platform::Collections::Vector<MemorySlot ^>();
for (int i = 1000; i < 1100; i++)
{
wchar_t wzi[5];
@@ -53,24 +55,22 @@ namespace Numbers
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_RW(Platform::String^, DisplayValue);
OBSERVABLE_PROPERTY_RW(Platform::String^, DisplayStringExpression);
OBSERVABLE_PROPERTY_RW(Platform::String^, DegreeButtonContent);
OBSERVABLE_PROPERTY_RW(Windows::Foundation::Collections::IVector<MemorySlot^>^, MemorizedNumbers);
OBSERVABLE_PROPERTY_RW(Platform::String ^, DisplayValue);
OBSERVABLE_PROPERTY_RW(Platform::String ^, DisplayStringExpression);
OBSERVABLE_PROPERTY_RW(Platform::String ^, DegreeButtonContent);
OBSERVABLE_PROPERTY_RW(Windows::Foundation::Collections::IVector<MemorySlot ^> ^, MemorizedNumbers);
OBSERVABLE_PROPERTY_RW(bool, IsMemoryEmpty);
OBSERVABLE_PROPERTY_RW(KeyboardButtonStates^, PressedButtons);
OBSERVABLE_PROPERTY_RW(KeyboardButtonStates ^, PressedButtons);
COMMAND_FOR_METHOD(ButtonPressed, StandardCalculatorViewModel::OnButtonPressed);
private:
void OnButtonPressed(Platform::Object^ parameter)
{ }
void OnButtonPressed(Platform::Object ^ parameter)
{
}
};
#endif
}
}

View File

@@ -10,86 +10,91 @@ namespace Numbers
#ifdef _DEBUG
// These class are to be consumed exclusively by Blend and the VS designer
// with these classes Blend will be able to populate the controls
// with the hardcoded strings so whoever is working on the UI can actually see how the app would look like
// with the hardcoded strings so whoever is working on the UI can actually see how the app would look like
// with semi-realistic data.
// This data is to only be compiled in the debug build and it will not affect app functionality at all
// This data is to only be compiled in the debug build and it will not affect app functionality at all
// so it does not need to be tested. It will have to be kept in sync with UnitConverterViewModel though
// to ensure that the design experience is correct.
// This class's code is run in the designer process so the less code it has the better.
// This class's code is run in the designer process so the less code it has the better.
public ref class CategoryViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
public
ref class CategoryViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
CategoryViewModel(Platform::String^ name) :
m_Name(name),
m_NegateVisibility(Windows::UI::Xaml::Visibility::Collapsed)
{}
CategoryViewModel(Platform::String ^ name)
: m_Name(name)
, m_NegateVisibility(Windows::UI::Xaml::Visibility::Collapsed)
{
}
CategoryViewModel(Platform::String^ name, Windows::UI::Xaml::Visibility negateVisibility) :
m_Name(name),
m_NegateVisibility(negateVisibility)
{}
CategoryViewModel(Platform::String ^ name, Windows::UI::Xaml::Visibility negateVisibility)
: m_Name(name)
, m_NegateVisibility(negateVisibility)
{
}
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_RW(Platform::String^, Name);
OBSERVABLE_PROPERTY_RW(Platform::String ^, Name);
OBSERVABLE_PROPERTY_RW(Windows::UI::Xaml::Visibility, NegateVisibility);
};
public ref class UnitViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
public
ref class UnitViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
UnitViewModel(Platform::String^ unit, Platform::String^ abbr) :
m_Name(unit),
m_Abbreviation(abbr)
{}
UnitViewModel(Platform::String ^ unit, Platform::String ^ abbr)
: m_Name(unit)
, m_Abbreviation(abbr)
{
}
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_RW(Platform::String^, Name);
OBSERVABLE_PROPERTY_RW(Platform::String^, Abbreviation);
OBSERVABLE_PROPERTY_RW(Platform::String ^, Name);
OBSERVABLE_PROPERTY_RW(Platform::String ^, Abbreviation);
};
public ref class UnitConverterSupplementaryResultViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
public
ref class UnitConverterSupplementaryResultViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
UnitConverterSupplementaryResultViewModel(Platform::String^ value, Platform::String^ unit, Platform::String^ abbr) :
m_Value(value)
UnitConverterSupplementaryResultViewModel(Platform::String ^ value, Platform::String ^ unit, Platform::String ^ abbr)
: m_Value(value)
{
m_Unit = ref new UnitViewModel(unit, abbr);
}
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_RW(Platform::String^, Value);
OBSERVABLE_PROPERTY_RW(UnitViewModel^, Unit);
OBSERVABLE_PROPERTY_RW(Platform::String ^, Value);
OBSERVABLE_PROPERTY_RW(UnitViewModel ^, Unit);
};
public ref class UnitConverterViewModel sealed: public Windows::UI::Xaml::Data::INotifyPropertyChanged
public
ref class UnitConverterViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
public:
UnitConverterViewModel():
m_Value1("Åy24"),
m_Value2("Åy183"),
m_Value1Active(true),
m_Value2Active(false)
UnitConverterViewModel()
: m_Value1("Åy24")
, m_Value2("Åy183")
, m_Value1Active(true)
, m_Value2Active(false)
{
m_SupplementaryResults = ref new Platform::Collections::Vector<UnitConverterSupplementaryResultViewModel^>();
m_SupplementaryResults = ref new Platform::Collections::Vector<UnitConverterSupplementaryResultViewModel ^>();
m_SupplementaryResults->Append(ref new UnitConverterSupplementaryResultViewModel("128", "Kilograms", "Kgs"));
m_SupplementaryResults->Append(ref new UnitConverterSupplementaryResultViewModel("42.55", "Liters", "ÅyL"));
m_SupplementaryResults->Append(ref new UnitConverterSupplementaryResultViewModel("1.5e3", "Gallons", "G"));
m_SupplementaryResults->Append(ref new UnitConverterSupplementaryResultViewModel("1929", "Gigabyte", "GB"));
m_Categories = ref new Platform::Collections::Vector<CategoryViewModel^>();
m_Categories = ref new Platform::Collections::Vector<CategoryViewModel ^>();
m_Categories->Append(ref new CategoryViewModel("Volume"));
m_Categories->Append(ref new CategoryViewModel("Temperature", Windows::UI::Xaml::Visibility::Visible));
m_CurrentCategory = ref new CategoryViewModel("ÅyTime");
m_Categories->Append(m_CurrentCategory);
m_Categories->Append(ref new CategoryViewModel("Speed"));
m_Units = ref new Platform::Collections::Vector<UnitViewModel^>();
m_Units = ref new Platform::Collections::Vector<UnitViewModel ^>();
m_Unit1 = ref new UnitViewModel("ÅySeconds", "S");
m_Unit2 = ref new UnitViewModel("ÅyMinutes", "M");
m_Units->Append(ref new UnitViewModel("Miliseconds", "MS"));
@@ -100,19 +105,18 @@ namespace Numbers
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_RW(Platform::String^, Value1);
OBSERVABLE_PROPERTY_RW(Platform::String^, Value2);
OBSERVABLE_PROPERTY_R(Windows::UI::Xaml::Interop::IBindableObservableVector^, Categories);
OBSERVABLE_PROPERTY_RW(CategoryViewModel^, CurrentCategory);
OBSERVABLE_PROPERTY_R(Windows::UI::Xaml::Interop::IBindableObservableVector^, Units);
OBSERVABLE_PROPERTY_RW(UnitViewModel^, Unit1);
OBSERVABLE_PROPERTY_RW(UnitViewModel^, Unit2);
OBSERVABLE_PROPERTY_RW(Platform::String ^, Value1);
OBSERVABLE_PROPERTY_RW(Platform::String ^, Value2);
OBSERVABLE_PROPERTY_R(Windows::UI::Xaml::Interop::IBindableObservableVector ^, Categories);
OBSERVABLE_PROPERTY_RW(CategoryViewModel ^, CurrentCategory);
OBSERVABLE_PROPERTY_R(Windows::UI::Xaml::Interop::IBindableObservableVector ^, Units);
OBSERVABLE_PROPERTY_RW(UnitViewModel ^, Unit1);
OBSERVABLE_PROPERTY_RW(UnitViewModel ^, Unit2);
OBSERVABLE_PROPERTY_RW(bool, Value1Active);
OBSERVABLE_PROPERTY_RW(bool, Value2Active);
OBSERVABLE_PROPERTY_R(Windows::UI::Xaml::Interop::IBindableObservableVector^, SupplementaryResults);
OBSERVABLE_PROPERTY_R(Windows::UI::Xaml::Interop::IBindableObservableVector ^, SupplementaryResults);
};
#endif
}
}

View File

@@ -8,7 +8,7 @@
<Logo>Assets\CalculatorStoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17133.0" MaxVersionTested="10.0.17763.0" />
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17133.0" MaxVersionTested="10.0.18362.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft-Dienste-ooreenkoms</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Rolberekening-resultaat is links</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Rolberekening-resultaat is regs</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>የ Microsoft አገልግሎቶች ስምምነት</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>ፒዮንግ</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>ፒዮንግ</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>የስሌት ውጤቱን ወደ ግራ ይሸብልሉ</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>የስሌት ውጤቱን ወደ ቀኝ ይሸብልሉ</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2908,4 +2908,20 @@
<value>اتفاقية خدمات Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>بيونغ</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>بيونغ</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>تمرير نتيجة الحساب إلى اليسار</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>تمرير نتيجة الحساب إلى اليمين</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft Xidmət Müqaviləsi</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Hesablama nəticəsini sola sürüşdürün</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Hesablama nəticəsini sağa sürüşdürün</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Пагадненне аб выкарыстанні сэрвісаў Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Пхён</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Пхён</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Прагартаць вынікі вылічэння ўлева</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Прагартаць вынікі вылічэння ўправа</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Споразумение за услуги на Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Превъртане наляво на резултата от изчислението</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Превъртане надясно на резултата от изчислението</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft পরিষেবা চুক্তি</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>পিয়ং</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>পিয়ং</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>স্ক্রোল গণনা ফলাফল বাম</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>স্ক্রোল গণনা ফলাফল ডান</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Contracte de serveis de Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Desplaça el resultat del càlcul a l'esquerra</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Desplaça el resultat del càlcul a la dreta</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Smlouva o poskytování služeb společnosti Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Posunout výsledek výpočtu doleva</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Posunout výsledek výpočtu doprava</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft-serviceaftale</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Rul til venstre for beregningsresultat</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Rul til højre for beregningsresultat</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft-Servicevertrag</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Berechnungsergebnis nach links scrollen</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Berechnungsergebnis nach rechts scrollen</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Σύμβαση παροχής υπηρεσιών της Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Κύλιση αποτελέσματος υπολογισμού προς τα αριστερά</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Κύλιση αποτελέσματος υπολογισμού προς τα δεξιά</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft Services Agreement</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Scroll Calculation Result Left</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Scroll Calculation Result Right</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2904,9 +2904,9 @@
<value>Difference</value>
<comment>Difference result label</comment>
</data>
<data name="Date_FromLabel.Text" xml:space="preserve">
<data name="DateDiff_FromHeader.Header" xml:space="preserve">
<value>From</value>
<comment>From Date label for Date Picker</comment>
<comment>From Date Header for Difference Date Picker</comment>
</data>
<data name="MonthsLabel.Text" xml:space="preserve">
<value>Months</value>
@@ -2916,9 +2916,9 @@
<value>Subtract</value>
<comment>Subtract toggle button text</comment>
</data>
<data name="Date_ToLabel.Text" xml:space="preserve">
<data name="DateDiff_ToHeader.Header" xml:space="preserve">
<value>To</value>
<comment>To Date label for Date Picker</comment>
<comment>To Date Header for Difference Date Picker</comment>
</data>
<data name="YearsLabel.Text" xml:space="preserve">
<value>Years</value>
@@ -3379,6 +3379,30 @@
<value>Microsoft Services Agreement</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="AddSubtract_Date_FromHeader.Header" xml:space="preserve">
<value>From</value>
<comment>From Date Header for AddSubtract Date Picker</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Scroll Calculation Result Left</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Scroll Calculation Result Right</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationFailed" xml:space="preserve">
<value>Calculation failed</value>
<comment>Text displayed when the application is not able to do a calculation</comment>
</data>
<data name="GraphingCalculatorModeText" xml:space="preserve">
<value>Graphing</value>
<comment>Name of the Graphing mode of the Calculator app. Displayed in the navigation menu.</comment>

View File

@@ -2907,4 +2907,20 @@
<value>Contrato de servicios de Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
</root>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Desplazar el resultado del cálculo hacia la izquierda</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Desplazar el resultado del cálculo hacia la derecha</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Contrato de servicios de Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Desplazar el resultado del cálculo a la izquierda</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Desplazar el resultado del cálculo a la derecha</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsofti teenuselepe</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Keri arvutustulemust vasakule</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Keri arvutustulemust paremale</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft-en zerbitzu-hitzarmena</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Mugitu kalkulu-emaitza ezkerrera</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Mugitu kalkulu-emaitza eskuinera</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>توافق‌نامه سرویس‌های Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>پیونگ</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>پیونگ</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>نتیجه محاسبه پیمایش چپ</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>نتیجه محاسبه پیمایش راست</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoftin palvelusopimus</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Vieritä laskentatulosta vasemmalle</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Vieritä laskentatulosta oikealle</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Kasunduan sa Mga Serbisyo ng Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>I-scroll ang Resulta ng Kalkulasyon Pakaliwa</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>I-scroll ang Resulta ng Kalkulasyon Pakanan</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Contrat de services Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Défilement à gauche du résultat du calcul</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Défilement à droite du résultat du calcul</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Contrat de services Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Faire défiler les résultats du calcul vers la gauche</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Faire défiler les résultats du calcul vers la droite</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Contrato de servizos de Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Despraza o resultado do cálculo cara á esquerda</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Despraza o resultado do cálculo cara á dereita</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>הסכם השירותים של Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>פיונג</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>פיונג</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>גלול תוצאת חישוב שמאלה</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>גלול תוצאת חישוב ימינה</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft सेवा अनुबंध</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>परिकलन परिणाम बाईं ओर स्क्रॉल करें</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>परिकलन परिणाम दाईं ओर स्क्रॉल करें</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoftov ugovor o pružanju usluga</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Pomaknite rezultat izračuna lijevo</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Pomaknite rezultat izračuna desno</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>A Microsoft szolgáltatási szerződése</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Számítási eredmény balra görgetése</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Számítási eredmény jobbra görgetése</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Perjanjian Layanan Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Gulir Hasil Penghitungan ke Kiri</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Gulir Hasil Penghitungan ke Kanan</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Þjónustusamningur Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Fletta útreikningsniðurstöðu til vinstri</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Fletta útreikningsniðurstöðu til hægri</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Contratto di Servizi Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Scorri il risultato del calcolo verso sinistra</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Scorri il risultato del calcolo verso destra</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft サービス規約</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>坪</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>坪</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>計算結果を左へスクロール</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>計算結果を右へスクロール</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft қызметтер келісімі</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Пен</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Пен</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Есептеу нәтижесін солға айналдыру</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Есептеу нәтижесін оңға айналдыру</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>កិច្ចព្រមព្រៀងសេវាកម្ម​ Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>រំកិលលទ្ធផលការគណនាទៅឆ្វេង</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>រំកិលលទ្ធផលការគណនាទៅស្ដាំ</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft ಸೇವೆಗಳ ಒಪ್ಪಂದ</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>ಲೆಕ್ಕಾಚಾರ ಫಲಿತಾಂಶವನ್ನು ಎಡಕ್ಕೆ ಸ್ಕ್ರಾಲ್ ಮಾಡಿ</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>ಲೆಕ್ಕಾಚಾರ ಫಲಿತಾಂಶವನ್ನು ಬಲಕ್ಕೆ ಸ್ಕ್ರಾಲ್ ಮಾಡಿ</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft 서비스 계약</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>평</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>평</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>계산 결과 왼쪽으로 스크롤</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>계산 결과 오른쪽으로 스크롤</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>ຂໍ້ຕົກລົງ ການບໍລິການ Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>ເລື່ອນຜົນການຄິດໄລ່ໄປຊ້າຍ</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>ເລື່ອນຜົນການຄິດໄລ່ໄປຂວາ</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>„Microsoft“ paslaugų teikimo sutartis</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Slinkti skaičiavimo rezultatą į kairę</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Slinkti skaičiavimo rezultatą į dešinę</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft pakalpojumu līgums</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Ritināt aprēķina rezultātu pa kreisi</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Ritināt aprēķina rezultātu pa labi</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Договор за услуги на Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Пјеонг</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Пјеонг</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Листај го резултатот на пресметката налево</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Листај го резултатот на пресметката надесно</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsoft സേവന കരാർ</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>കാൽക്കുലേഷൻ ഫലം ഇടത്ത് സ്ക്രോൾ ചെയ്യുക</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>കാൽക്കുലേഷൻ ഫലം വലത്ത് സ്ക്രോൾ ചെയ്യുക</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Perjanjian Perkhidmatan Microsoft</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Tatal Hasil Pengiraan Ke Kiri</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Tatal Hasil Pengiraan Ke Kanan</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

View File

@@ -2907,4 +2907,20 @@
<value>Microsofts tjenesteavtale</value>
<comment>Displayed on a link to the Microsoft Services Agreement in the about this app information</comment>
</data>
<data name="UnitAbbreviation_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>An abbreviation for a measurement unit of area.</comment>
</data>
<data name="UnitName_Pyeong" xml:space="preserve">
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Bla beregningsresultat til venstre</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
<data name="CalculationResultScrollRight.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Bla beregningsresultat til høyre</value>
<comment>Automation label for the "Scroll Right" button that appears when a calculation result is too large to fit in calculation result text box.</comment>
</data>
</root>

Some files were not shown because too many files have changed in this diff Show More