Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 191757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:22:07+00:00 2026-05-11T16:22:07+00:00

I have a simple user control to display a hyperlink in a textblock: LinkTextBlock.xaml:

  • 0

I have a simple user control to display a hyperlink in a textblock:

LinkTextBlock.xaml:

<TextBlock >
    <Hyperlink NavigateUri="{Binding Url, ElementName=root}" >
        <TextBlock Text="{Binding Text, ElementName=root}" />
    </Hyperlink>   
</TextBlock>

LinkTextBlock.xaml.cs:

public static readonly DependencyProperty UrlProperty = DependencyProperty.Register("Url", typeof (string), typeof (LinkTextBlock));
public string Url
{
    get { return (string) GetValue(UrlProperty); }
    set { SetValue(UrlProperty, value); }
}
public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof (string), typeof (LinkTextBlock));
public string Text
{
    get { return (string) GetValue(TextProperty); }
    set { SetValue(TextProperty, value); }
}

Then, in a DataTemplate for a ListBox I have:

<Controls:LinkTextBlock Text="{Binding Email}" Url="{Binding Email}" />

When I run the application, it seems to work perfectly. The control shows the hyperlinks correctly and there are no apparent problems. However, when I look at the Output window I get exceptions, one for each ListBox item:

System.Windows.Data Error: 22 : Cannot
convert ” from type ” to
type ‘System.Uri’ for ‘en-US’ culture
with default conversions; consider
using Converter property of Binding.
NotSupportedException:’System.NotSupportedException:
UriTypeConverter cannot convert from
(null). at
System.ComponentModel.TypeConverter.GetConvertFromException(Object
value) at
System.ComponentModel.TypeConverter.ConvertFrom(ITypeDescriptorContext
context, CultureInfo culture, Object
value) at
System.UriTypeConverter.ConvertFrom(ITypeDescriptorContext
context, CultureInfo culture, Object
value) at
MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object
o, Type destinationType,
DependencyObject targetElement,
CultureInfo culture, Boolean
isForward)’

Why is this happening? I know the binding error is a result of the binding to NavigateURI.
Do you have any suggestions for me? What can I do about it? I really appreciate your inputs.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:22:07+00:00Added an answer on May 11, 2026 at 4:22 pm

    I figured it out. The problem is when performing an implicit conversion from string to Uri, since NavigateUri is of type Uri.
    I needed to create a converter to convert string to Uri, change my property from String to Uri, and it all worked fine without exceptions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple form on a view page, implemented as a user control,
All I want is to display some simple text in my viewController and have
I have a simple user control with the following content: <Grid x:Name=LayoutRoot> <Button x:Name=btnOpenGenericPage
I have a simple user control, which is essentially just an AutoCompleteBox with some
I have a simple database with two tables. Users and Configurations. A user has
I have built a simple Eclipse plugin where a user may use a TableViewer
I have implemented a simple file upload-download mechanism. When a user clicks a file
I currently have a user control that is used on both an /Address/Edit and
I'm utilizing the code posted by Jesper Palm here: Make user control display outside
I’m having issues with a WPF Expander that I have in a user control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.