Hyperlink label that opens an URL in the default browser.
Inheritance: System.Windows.Controls.Label
Beispiel #1
0
        private void CreateLink() {
            Link website_link = new Link(Properties_Resources.Website, Controller.WebsiteLinkAddress);
            Link credits_link = new Link(Properties_Resources.Credits, Controller.CreditsLinkAddress);
            Link report_problem_link = new Link(Properties_Resources.ReportProblem, Controller.ReportProblemLinkAddress);

            canvas.Children.Add(website_link);
            Canvas.SetLeft(website_link, 289);
            Canvas.SetTop(website_link, 222);

            canvas.Children.Add(credits_link);
            Canvas.SetLeft(credits_link, 289 + website_link.ActualWidth + 60);
            Canvas.SetTop(credits_link, 222);

            canvas.Children.Add(report_problem_link);
            Canvas.SetLeft(report_problem_link, 289 + website_link.ActualWidth + credits_link.ActualWidth + 115);
            Canvas.SetTop(report_problem_link, 222);
        }
Beispiel #2
0
        /// <summary>
        /// Create the GUI.
        /// </summary>
        private void CreateAbout ()
        {
            Image image = new Image () {
                Width  = 640,
                Height = 260
            };

            image.Source = UIHelpers.GetImageSource ("about");


            Label version = new Label () {
                Content = String.Format(Properties_Resources.Version, Controller.RunningVersion),
                FontSize   = 11,
                Foreground = new SolidColorBrush (Color.FromRgb (135, 178, 227))
            };

            this.updates = new Label () {
                Content    = Properties_Resources.ResourceManager.GetString(
                    "PleaseCheckForUpdates", CultureInfo.CurrentCulture), // Previously: "Checking for updates...",
                FontSize   = 11,
                Foreground = new SolidColorBrush (Color.FromRgb (135, 178, 227))
            };

            TextBlock credits = new TextBlock () {
                FontSize     = 11,
                Foreground = new SolidColorBrush (Color.FromRgb (135, 178, 227)),
                Text         = "Copyright © 2010–" + DateTime.Now.Year.ToString() + " Aegif and others.\n" +
                    "\n" +
                    Properties_Resources.ResourceManager.GetString("OpenSource", CultureInfo.CurrentCulture),
                TextWrapping = TextWrapping.Wrap,
                Width        = 318
            };

            Link website_link = new Link(Properties_Resources.ResourceManager.GetString(
                "Website", CultureInfo.CurrentCulture), Controller.WebsiteLinkAddress);
            Link credits_link = new Link(Properties_Resources.ResourceManager.GetString(
                "Credits", CultureInfo.CurrentCulture), Controller.CreditsLinkAddress);
            Link report_problem_link = new Link(Properties_Resources.ResourceManager.GetString(
                "ReportProblem", CultureInfo.CurrentCulture), Controller.ReportProblemLinkAddress);

            Canvas canvas = new Canvas ();

            canvas.Children.Add (image);
            Canvas.SetLeft (image, 0);
            Canvas.SetTop (image, 0);

            canvas.Children.Add (version);
            Canvas.SetLeft (version, 289);
            Canvas.SetTop (version, 92);

            canvas.Children.Add (this.updates);
            Canvas.SetLeft (this.updates, 289);
            Canvas.SetTop (this.updates, 109);

            canvas.Children.Add (credits);
            Canvas.SetLeft (credits, 294);
            Canvas.SetTop (credits, 142);

            canvas.Children.Add (website_link);
            Canvas.SetLeft (website_link, 289);
            Canvas.SetTop (website_link, 222);

            canvas.Children.Add (credits_link);
            Canvas.SetLeft (credits_link, 289 + website_link.ActualWidth + 60);
            Canvas.SetTop (credits_link, 222);

            canvas.Children.Add (report_problem_link);
            Canvas.SetLeft (report_problem_link, 289 + website_link.ActualWidth + credits_link.ActualWidth + 115);
            Canvas.SetTop (report_problem_link, 222);

            Content = canvas;
        }
Beispiel #3
0
        /// <summary>
        /// Create the UI.
        /// </summary>
        private void CreateAbout ()
        {
            Image image = new Image () {
                Width  = 640,
                Height = 260
            };
        
            image.Source = UIHelpers.GetImageSource ("about");
            
            
            Label version = new Label () {
                Content    = "Version " + Controller.RunningVersion,
                FontSize   = 11,
                Foreground = new SolidColorBrush (Color.FromRgb (135, 178, 227))
            };

            TextBlock credits = new TextBlock () {
                FontSize     = 11,
                Foreground = new SolidColorBrush (Color.FromRgb (135, 178, 227)),
                Text         = "Copyright ©" + DateTime.Now.Year.ToString() + 
                    " 2ndAct Innovations Inc. All rights reserved. .\n" +
                    "\n" +
                    "Oris4 Sync is Open Source software. You are free to use, modify, " +
                    "and redistribute it under the GNU General Public License version 3 or later.",
                TextWrapping = TextWrapping.Wrap,
                Width        = 318
            };
            
			Link website_link = new Link ("Website", Controller.WebsiteLinkAddress);
			Link credits_link = new Link ("Credits", Controller.CreditsLinkAddress);
			Link report_problem_link = new Link ("Report a problem", Controller.ReportProblemLinkAddress);

            Canvas canvas = new Canvas ();
            
            canvas.Children.Add (image);
            Canvas.SetLeft (image, 0);
            Canvas.SetTop (image, 0);

            canvas.Children.Add (version);
            Canvas.SetLeft (version, 289);
            Canvas.SetTop (version, 92);
            
            canvas.Children.Add (credits);
            Canvas.SetLeft (credits, 294);
            Canvas.SetTop (credits, 142);   

			canvas.Children.Add (website_link);
            Canvas.SetLeft (website_link, 289);
            Canvas.SetTop (website_link, 222);   

			canvas.Children.Add (credits_link);
            Canvas.SetLeft (credits_link, 289 + website_link.ActualWidth + 60);
            Canvas.SetTop (credits_link, 222);

			canvas.Children.Add (report_problem_link);
            Canvas.SetLeft (report_problem_link, 289 + website_link.ActualWidth + credits_link.ActualWidth + 115);
            Canvas.SetTop (report_problem_link, 222);   
            
            Content = canvas;
        }