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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:32:41+00:00 2026-06-03T08:32:41+00:00

I am creating an auto-complete box, which uses a list of valid values (objects,

  • 0

I am creating an auto-complete box, which uses a list of valid values (objects, not strings). The objects are bound directly and the box (both text box and drop-down parts) use a DisplayMemberPath to determine what to show as text.

I want the user to be able to type in text – if the text does not match one of the valid values, I want it to remain in the box and be flagged as invalid visually.

Now, when I bind to the view model, obviously I need to set something for this invalid value. I tried setting the value to DependencyProperty.UnsetValue. This gets returned to the VM as null.

If I later want to “clear” my form, I set the VM property to null, but of course this does not filter through to the control, as the value has not changed.

I would have expected the Property system to notice that the new value is null and the old value was UnsetValue and therefore fire the event.

Have I missed something obvious?

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-06-03T08:32:43+00:00Added an answer on June 3, 2026 at 8:32 am

    Instead of setting DependencyProperty.UnsetValue, which has a special meaning to the WPF framework, you could create your own marker object for invalid values, like

    public static Object Dummy = new Object();
    

    Instead of Object, you should probably use the same class that your valid values have. Now, when you reset the VM, the value will really change, and WPF will notice the difference.

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

Sidebar

Related Questions

I'm creating an autocomplete from a page that returnes values as a text list,
I'm creating an auto complete and I'm having a little problem the results highlighting.
How would I go about creating an auto-complete field in a PHP form? I
I am creating an auto-complete control that updates as the user types text. Every
I am currently creating a autocomplete textview which uses data from the contacts. I
I'm using c# and creating an auto downloader/updater, that checks to see if the
Is there any way to create a css box-shadow in which regardless of the
I'm creating my own recipe box using php/mysql and one part I'm stuck on
I just finished creating T4 templates to auto-generate property implementations for my ViewModel classes
I am using JQuery UI autocomplete on my website. I am creating the auto

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.