Before this change, the pchs for CalcViewModel and Calculator project referenced project headers. If those project headers (or any of their dependencies) were to change, then the pch would be recompiled, slowing local build times. By removing references to project headers, the pch will be compiled once and is resilient to changes in the project. Now that project headers are explicit about their dependencies, when there is a change to a project header only the translation units referencing the modified header will need to be rebuilt. - Manually tested by ensuring Calculator project builds locally. @Microsoft/calculator-team
60 lines
2.1 KiB
C++
60 lines
2.1 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#include "pch.h"
|
|
#include "AboutFlyout.xaml.h"
|
|
#include "CalcViewModel/Common/AppResourceProvider.h"
|
|
#include "CalcViewModel/Common/LocalizationService.h"
|
|
#include "CalcViewModel/Common/LocalizationStringUtil.h"
|
|
#include "CalcViewModel/Common/TraceLogger.h"
|
|
|
|
using namespace CalculatorApp;
|
|
using namespace CalculatorApp::Common;
|
|
using namespace Platform;
|
|
using namespace Windows::ApplicationModel;
|
|
using namespace Windows::Foundation;
|
|
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;
|
|
|
|
AboutFlyout::AboutFlyout()
|
|
{
|
|
auto locService = LocalizationService::GetInstance();
|
|
auto resourceLoader = AppResourceProvider::GetInstance();
|
|
|
|
InitializeComponent();
|
|
|
|
Language = locService->GetLanguage();
|
|
|
|
this->SetVersionString();
|
|
|
|
Header->Text = resourceLoader.GetResourceString("AboutButton/Content");
|
|
}
|
|
|
|
void AboutFlyout::FeedbackButton_Click(_In_ Object^ sender, _In_ RoutedEventArgs^ e)
|
|
{
|
|
PackageVersion version = Package::Current->Id->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"));
|
|
}
|
|
|
|
void AboutFlyout::SetVersionString()
|
|
{
|
|
PackageVersion version = Package::Current->Id->Version;
|
|
String^ appName = AppResourceProvider::GetInstance().GetResourceString(L"AppName");
|
|
AboutFlyoutVersion->Text = appName + L" " + version.Major + L"." + version.Minor + L"." + version.Build + L"." + version.Revision;
|
|
}
|
|
|
|
void AboutFlyout::SetDefaultFocus()
|
|
{
|
|
AboutFlyoutEULA->Focus(::FocusState::Programmatic);
|
|
}
|
|
|
|
void CalculatorApp::AboutFlyout::UserControl_Loaded(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
|
|
{
|
|
TraceLogger::GetInstance().LogAboutFlyoutOpened();
|
|
}
|