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

  • Home
  • SEARCH
  • 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 3283790
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:04:54+00:00 2026-05-17T20:04:54+00:00

Before I explain my issue, consider the following object: Character.cs -> AnimationControlSettings.cs .. ->

  • 0

Before I explain my issue, consider the following object:

Character.cs

-> AnimationControlSettings.cs

..  -> UpControlType (string)

..  -> AvailableControlTypes (List<string>)

The relevant properties in my ViewModel:

Character SelectedCharacter
ObservableCollection<Character> Characters

I have a simple View where you select a character using a ComboBox. The ComboBox’s SelectedItem is TwoWay-bound to the ViewModel’s SelectedCharacter property. There are other textboxes/checkboxes (also two-way bound to various properties of SelectedCharacter) that maintain their values properly as I switch between Characters.

The problem exists in the ComboBox bound to the UpControlType property:

<ComboBox x:Name="lstUpControlTypes" 
        ItemsSource="{Binding Path=SelectedCharacter.AnimationControlSettings.AvailableControlTypes}" 
        SelectedItem="{Binding Path=SelectedCharacter.AnimationControlSettings.UpControlType, Mode=TwoWay}">
</ComboBox>

Initial values are displayed in this ComboBox correctly but as soon as I switch from CharacterA to CharacterB, CharacterA’s UpControl property is set to NULL and I have no idea why.

Here is a barebones repro of this exact issue (VS2010, SL4):
http://www.checksumlabs.com/source/TwoWayBindingWorkshop.zip

If you run that solution you’ll see that the Name property persists as you switch Characters but the UpControlType value’s getting set to NULL.

Am I missing something obvious here?

  • 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-17T20:04:55+00:00Added an answer on May 17, 2026 at 8:04 pm

    You are binding the items source of the third combo box to a property inside the SelectedCharacter, like this:

    ItemsSource="{Binding SelectedCharacter.AnimationControlSettings.AvailableControlTypes}" 
    

    This means that when SelectedCharacter changes the items source for that combo box will be reset and this activates the two way binding you set in the SelectedItem of the same combo box, setting your property to null:

    SelectedItem="{Binding SelectedCharacter.AnimationControlSettings.UpControlType, Mode=TwoWay}"
    

    I was able to fix the issue by moving the property AvailableControlTypes to the CharacterViewModel class, which means that when you change the character, the available types remain the same. If this is acceptable in your situation, it will fix your problem:

                <ComboBox x:Name="lstUpControlTypes" 
                          ItemsSource="{Binding AvailableControlTypes}" 
                          SelectedItem="{Binding     SelectedCharacter.AnimationControlSettings.UpControlType, Mode=TwoWay}" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following situation: I want to replace links in a string, specifically I
Before delving into the issue, first I will explain the situation. I have two
this shell explain the issue , after executing the .sh file halt and nothing
May be it's the same question i have i asked before but the issue
I stumbled upon an interesting error that I've never seen before, and can't explain
Update following initial comments The model has an object in it called 'Account', of
Before you answer this I have never developed anything popular enough to attain high
Before I start, I know there is this post and it doesn't answer my
Before I do this I figured I would ask if it was the best
Before I jump headlong into C#... I've always felt that C, or maybe C++,

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.