Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何让NavigateUri在WPF窗口中工作?_C#_Wpf_Xaml - Fatal编程技术网

C# 如何让NavigateUri在WPF窗口中工作?

C# 如何让NavigateUri在WPF窗口中工作?,c#,wpf,xaml,C#,Wpf,Xaml,mailto链接在此示例中不起作用: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <TextBlock>Please email <Hyperlink NavigateUri="mailto:test@test.co.uk

mailto链接在此示例中不起作用:

<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <TextBlock>Please email
        <Hyperlink NavigateUri="mailto:test@test.co.uk">test@test.cp.uk</Hyperlink>
    </TextBlock>
</Window>

请发电子邮件
test@test.cp.uk
如果我将窗口更改为UserControl,它就会工作


有人能帮忙吗?

在Xaml中:您需要添加RequestNavigate

                    <TextBlock >
                        Please email <Hyperlink NavigateUri="mailto:test@test.co.uk"  RequestNavigate="Hyperlink_RequestNavigate">test@test.cp.uk</Hyperlink>
                    </TextBlock>

在Xaml中:您需要添加RequestNavigate

                    <TextBlock >
                        Please email <Hyperlink NavigateUri="mailto:test@test.co.uk"  RequestNavigate="Hyperlink_RequestNavigate">test@test.cp.uk</Hyperlink>
                    </TextBlock>

你可能想看一看这个问题:也看一看这个:你可能想看一看这个问题:也看一看这个:吃了一顿饭。感谢您的帮助。我得到异常“Program not found”。+1如果您得到异常,表示系统找不到指定的文件,请使用
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri){UseShellExecute=true})取代了上面的行。工作很愉快。感谢您的帮助。我得到异常“Program not found”。+1如果您得到异常,表示系统找不到指定的文件,请使用
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri){UseShellExecute=true})代替上面的行。