This repository has been archived by the owner on Sep 25, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AboutPage.xaml.cs
77 lines (61 loc) · 2.59 KB
/
AboutPage.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* Copyright © 2013 Nokia Corporation. All rights reserved.
* Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation.
* Other product and company names mentioned herein may be trademarks
* or trade names of their respective owners.
* See LICENSE.TXT for license information.
*/
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
using RealtimeFilterDemo.Resources;
using System;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
using System.Xml.Linq;
namespace RealtimeFilterDemo
{
public partial class AboutPage : PhoneApplicationPage
{
public AboutPage()
{
InitializeComponent();
// Application version number
var version = XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value;
var versionRun = new Run()
{
Text = String.Format(AppResources.AboutPage_VersionRun_Text, version) + "\n"
};
VersionParagraph.Inlines.Add(versionRun);
// Application about text
var aboutRun = new Run()
{
Text = AppResources.AboutPage_AboutRun_Text + "\n"
};
AboutParagraph.Inlines.Add(aboutRun);
// Link to project homepage
var projectRunText = AppResources.AboutPage_ProjectRun_Text;
var projectRunTextSpans = projectRunText.Split(new string[] { "{0}" }, StringSplitOptions.None);
var projectRunSpan1 = new Run();
projectRunSpan1.Text = projectRunTextSpans[0];
var projectsLink = new Hyperlink();
projectsLink.Inlines.Add(AppResources.AboutPage_Hyperlink_Project);
projectsLink.Click += ProjectsLink_Click;
projectsLink.Foreground = new SolidColorBrush((Color)App.Current.Resources["PhoneForegroundColor"]);
projectsLink.MouseOverForeground = new SolidColorBrush((Color)App.Current.Resources["PhoneAccentColor"]);
var projectRunSpan2 = new Run();
projectRunSpan2.Text = projectRunTextSpans[1] + "\n";
ProjectParagraph.Inlines.Add(projectRunSpan1);
ProjectParagraph.Inlines.Add(projectsLink);
ProjectParagraph.Inlines.Add(projectRunSpan2);
}
private void ProjectsLink_Click(object sender, RoutedEventArgs e)
{
var webBrowserTask = new WebBrowserTask()
{
Uri = new Uri(AppResources.AboutPage_Hyperlink_Project, UriKind.Absolute)
};
webBrowserTask.Show();
}
}
}