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 3488708
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:18:13+00:00 2026-05-18T11:18:13+00:00

I have a TextBox that is bound to my ViewModel. The TextWrapping property of

  • 0

I have a TextBox that is bound to my ViewModel. The TextWrapping property of the TextBox is bound to a property on my View Model called DocViewerWrapText. Here is my Property – ignore the bits about turning on and off the scollbar.

 public string DocViewerWrapText
{
  get { return _docViewerWrapText; }
  set
  {
    _docViewerWrapText = value;

    if (_docViewerWrapText == "Wrap")
      ShowDocViewerHorizontalScrollBar = "Disabled";
    else ShowDocViewerHorizontalScrollBar = "Auto";
    NotifyPropertyChanged("ShowDocViewerHorizontalScrollBar");
    NotifyPropertyChanged("DocViewerWrapText");
  }
}

This code actually works just fine, but it throws a First Chance Exception as follows:

System.Windows.Data Error: 'MS.Internal.Data.DynamicValueConverter' converter failed to convert value 'NoWrap' (type 'System.String'); BindingExpression: Path='DocViewerWrapText' DataItem='UnityEca.ViewModels.HomeViewModel' (HashCode=41697354); target element is 'Telerik.Windows.Controls.RadToggleButton' (Name='docViewerWrapText'); target property is 'IsChecked' (type 'System.Nullable`1[System.Boolean]').. System.FormatException: String was not recognized as a valid Boolean.

I’ve tried converting my Property to a boolean, but I get the same type of error. I’ve also looked at the actual enum for the TextWrapping enum. The values are 1 and 2, so I don’t see how I could use a boolean here anyway.

Can someone tell me the proper way to bind to enums such as this in XAML?

Thanks,

-Scott

  • 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-18T11:18:14+00:00Added an answer on May 18, 2026 at 11:18 am

    I found the problem. I needed to change the propety getter/setter to return the correct Enum type. The issue that was confusing me was the boolean error. It turns out that was coming from a pushbutton I had on the form to toggle the text wrapping value. I have it bound to the same property, so it was not able to convert from Enum value to Boolean.

    Now I just need to figure out how to convert the values.

    -Scott

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

Sidebar

Related Questions

I have a textbox that is bound to a property on my ViewModel called
I have a textbox that i am binding to the viewmodel's string property. The
I have a TextBox bound to a ViewModel's Text property with the following setup:
I have validation hooked up to a model that is bound to the TextBox
I have a TextBox control on my form that is bound to a property
For example, I have a textbox that I need to have a Left property
In the example below, we have bound a ViewModel to a view with a
In my ViewModel, I have a class A with a child property B that
I have a view that contains a list of items, a TextBox and a
I have a TreeView which I have bound to a ViewModel called RootViewModel which

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.