Answer the question
In order to leave comments, you need to log in
How to set Hyperlink property NavigateUri in XAML from resources?
I'm trying to set the Hyperlink property to NavigateUri like this:
<Hyperlink NavigateUri="{x:Static res:Resources.MyLink}"
RequestNavigate="Hyperlink_RequestNavigate" >
<Run Text="{x:Static res:Resources.MyLinkName}" />
</Hyperlink>
System.Windows.Markup.XamlParseException occurred
HResult=-2146233087
Message="Setting the property 'System.Windows.Documents.Hyperlink.NavigateUri' threw an exception.": line number "94" and line position "14".
Source=PresentationFramework
http://www.apache.org/
Answer the question
In order to leave comments, you need to log in
I asked the question myself, and I will answer it myself. This is how it works:
<Hyperlink NavigateUri="{Binding Source={x:Static res:Resources.MyLink}}"
RequestNavigate="Hyperlink_RequestNavigate" >
<Run Text="{x:Static res:Resources.MyLinkName}" />
</Hyperlink>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question