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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:04:49+00:00 2026-05-16T15:04:49+00:00

I have a UserControl with a property of type Dictionary, called HighlightedDates . The

  • 0

I have a UserControl with a property of type Dictionary, called HighlightedDates. The property holds a set of dates, with a tool tip string for each date, and it works fine when set from code.

I want to bind the HighlightedDates property to a view model property, DatesWithNotes, of the same type, using this markup:

<MyControls:MyCalendar SelectedDate="{Binding SelectedDate}"
                       HighlightedDates="{Binding DatesWithNotes}" />

Unfortunately, I get this exception when I try to do that:

A ‘Binding’ cannot be set on the ‘Value’ property of type ‘DictionaryEntry’. A ‘Binding’ can only be set on a DependencyProperty of a DependencyObject.

It looks like WPF is trying to bind an individual entry, not the Dictionary itself.

As an alternative, I am looking at having the view model push each new value added to its dictionary out to the user control’s dictionary, which seems awfully clumsy. And that brings me to my question: Is there a way to make this binding work? Thanks for your help.

  • 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-16T15:04:49+00:00Added an answer on May 16, 2026 at 3:04 pm

    This problem gets more interesting. Karmicpuppet attempted to reproduce the error using a simple test project–see his comment above. He didn’t get the error in his test, but I got it when I ran the same test.

    I have read quite a bit about problems involved in databinding to a dictionary object. In my project, I refactored to eliminate the dictionary and moved on. I haven’t heard any other suggestions, so I am going to close out this question.

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

Sidebar

Related Questions

I have a UserControl with a property called Type. This can have any combination
I have a UserControl with a dependency property called ItemsSource . When the property
I have a UserControl (lets say Foo.ascx) that has a Type public property with
I have a UserControl that exposes a System.Type property. I want to make it
I have a UserControl with a Template property that I've set up as a
I have a UserControl, with a TextBox and a databound property - Value. Value
I have implemented my own usercontrol based on listboxes. It has a dependency property
I have a UserControl that incorporates a textbox. I want to set the keyboardfocus
I have a usercontrol with a Tree inside it with, the command property binds
First, my scenario. I have a ViewModel with a public property Items of type

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.