diff --git a/src/Calculator/Resources/en-US/Resources.resw b/src/Calculator/Resources/en-US/Resources.resw
index c1e8686f..db363621 100644
--- a/src/Calculator/Resources/en-US/Resources.resw
+++ b/src/Calculator/Resources/en-US/Resources.resw
@@ -4734,4 +4734,8 @@
Settings
Text for the "Settings" header
-
+
+ To learn how you can contribute to Windows Calculator, visit the project on %HL%GitHub%HL%.
+ {Locked="%HL%GitHub%HL%"}
+
+
\ No newline at end of file
diff --git a/src/Calculator/SettingsPage.xaml b/src/Calculator/SettingsPage.xaml
index 8b538696..2206b4de 100644
--- a/src/Calculator/SettingsPage.xaml
+++ b/src/Calculator/SettingsPage.xaml
@@ -6,7 +6,7 @@
xmlns:local="using:CalculatorApp"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Background="{ThemeResource AppChromeAcrylicHostBackdropMediumLowBrush}"
- d:Height="455"
+ d:Height="465"
d:Width="445"
mc:Ignorable="d">
@@ -18,23 +18,24 @@
-
-
-
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
+
-
-
-
+
+
-
-
-
+
+
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
diff --git a/src/Calculator/SettingsPage.xaml.cpp b/src/Calculator/SettingsPage.xaml.cpp
index 302a1601..04d384bf 100644
--- a/src/Calculator/SettingsPage.xaml.cpp
+++ b/src/Calculator/SettingsPage.xaml.cpp
@@ -60,6 +60,8 @@ SettingsPage::SettingsPage()
{
SettingsSystemTheme->IsChecked = true;
}
+
+ InitializeContributeTextBlock();
}
void SettingsPage::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs ^ e)
@@ -71,6 +73,33 @@ void SettingsPage::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventA
}
}
+void SettingsPage::InitializeContributeTextBlock()
+{
+ std::wstring contributeHyperlinkText = resourceLoader->GetResourceString(L"SettingsContribute")->Data();
+
+ // The resource string has '%HL%' wrapped around 'GitHub'
+ // Break the string and assign pieces appropriately.
+ static const std::wstring delimiter{ L"%HL%" };
+ static const size_t delimiterLength{ delimiter.length() };
+
+ // Find the delimiters.
+ size_t firstSplitPosition = contributeHyperlinkText .find(delimiter, 0);
+ assert(firstSplitPosition != std::wstring::npos);
+ size_t secondSplitPosition = contributeHyperlinkText .find(delimiter, firstSplitPosition + 1);
+ assert(secondSplitPosition != std::wstring::npos);
+ size_t hyperlinkTextLength = secondSplitPosition - (firstSplitPosition + delimiterLength);
+
+ // Assign pieces.
+ auto contributeTextBeforeHyperlink = ref new String(contributeHyperlinkText.substr(0, firstSplitPosition).c_str());
+ auto contributeTextLink = ref new String(contributeHyperlinkText.substr(firstSplitPosition + delimiterLength, hyperlinkTextLength).c_str());
+ auto contributeTextAfterHyperlink = ref new String(contributeHyperlinkText.substr(secondSplitPosition + delimiterLength).c_str());
+
+ ContributeRunBeforeLink->Text = contributeTextBeforeHyperlink;
+ ContributeRunLink->Text = contributeTextLink;
+ ContributeRunAfterLink->Text = contributeTextAfterHyperlink;
+
+}
+
void SettingsPage::BackButtonClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e)
{
MainPageProperty->CollapseSettings();
diff --git a/src/Calculator/SettingsPage.xaml.h b/src/Calculator/SettingsPage.xaml.h
index 010f7fe3..5e9ca66c 100644
--- a/src/Calculator/SettingsPage.xaml.h
+++ b/src/Calculator/SettingsPage.xaml.h
@@ -19,6 +19,7 @@ namespace CalculatorApp
virtual void OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs ^ e) override;
private:
+ void InitializeContributeTextBlock();
void BackButtonClick(Platform::Object ^ sender, Windows::UI::Xaml::RoutedEventArgs ^ e);
void ColorSettingsButtonClicked(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void SettingsFeedbackButtonClick(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);