About.xaml.cs 1.48 KB
Newer Older
Sylvain Berfini's avatar
Sylvain Berfini committed
1 2 3 4 5 6 7 8 9
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
10 11 12 13
using System.Windows.Documents;
using Linphone.Resources;
using System.Globalization;
using System.Resources;
Sylvain Berfini's avatar
Sylvain Berfini committed
14 15 16 17 18 19 20 21

namespace Linphone.Views
{
    public partial class About : PhoneApplicationPage
    {
        public About()
        {
            InitializeComponent();
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
            ResourceManager resourceManager = new ResourceManager("Linphone.Resources.AppResources", typeof(AppResources).Assembly);

            int i = 0;
            string text = resourceManager.GetString("AboutText", CultureInfo.CurrentCulture);
            Paragraph paragraph = new Paragraph();
            foreach (var line in text.Split('\n'))
            {
                if (line.StartsWith("http://"))
                {
                    Hyperlink link = new Hyperlink();
                    link.NavigateUri = new Uri(line);
                    link.Inlines.Add(line);
                    link.TargetName = "_blank";

                    paragraph.Inlines.Add(link);
                    i++;
                }
                else
                {
                    paragraph.Inlines.Add(line);
                    paragraph.Inlines.Add(new LineBreak());
                }
            }
            AboutText.Blocks.Add(paragraph);
Sylvain Berfini's avatar
Sylvain Berfini committed
46 47 48
        }
    }
}