What is the most convenient way to embed a link in a wpf application?

I am creating a WPF application in which I want to send users to our site if software updates are available. What are the best methods for embedding a link in a WPF window?

Some questions: Can I include a clickable URL? Should I open the link in my web browser? If so, which command will open its default web browser? Do I have to include navigation controls in the app so that they can download updates from there?

+4
source share
1 answer

The tutorial response to deploying the application in which updates will be installed is to deploy ClickOnce. From MSDN: ClickOnce is a deployment technology that allows you to create self-updating Windows-based applications that you can install and run with minimal user interaction. When deploying ClickOnce, there are three main problems inherent in deploying ...

From http://msdn.microsoft.com/en-us/library/142dbbz4(v=vs.80).aspx

As for hyperlinks, you can add them to your "Help | About" section. For example, for Notepad ++ ...

Hyperlinks in the About Box

To add a hyperlink ...

<TextBlock> <Hyperlink NavigateUri="http://www.bbc.co.uk" Click="Hyperlink_Click" >BBC</Hyperlink> </TextBlock> 

And the callback will be ...

 private void Hyperlink_Click(object sender, RoutedEventArgs e) { Hyperlink hyperlink = sender as Hyperlink; if(hyperlink!=null) { Process.Start(hyperlink.NavigateUri.AbsoluteUri); } } 

This will open the default browser and make it go to the link address.

+6
source

Source: https://habr.com/ru/post/1387819/


All Articles