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

Ask A Question

Stats

  • Questions 108k
  • Answers 108k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Check out the VS2008 options found here... Tools -> Options… May 11, 2026 at 9:11 pm
  • Editorial Team
    Editorial Team added an answer in protected BDA da; public BusinessDataControllerBase() { // Initialize the… May 11, 2026 at 9:11 pm
  • Editorial Team
    Editorial Team added an answer This should do it: var dec = '-35:48:00'; var parts… May 11, 2026 at 9:11 pm

Related Questions

I currently have a user control that is used on both an /Address/Edit and
Update 3: the restrict access, using the security tab works now. (that's manually) now
We have a scenario where we want to display a list of items and
I have a DropDownList and a TextBox on a Page. When the user chooses
This is a common problem for all developers, I am looking for the best

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.