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 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

Before I start posting a ton of code I think I may be able
This is a bit convoluted but I will try to explain as best as
I've been reading a lot about this since I've been asked to fix a
I can't find a solution that works for me. I'm trying to preselect multiple
I am going through the awesome Rails Tutorial http://railstutorial.org/chapters/filling-in-the-layout#sec:custom_css I've run into an issue
I'm getting this error when uploading an image on my hosting. Request for the
SQL Server 2008: I've got a situation here in which I wish to read
I've opted to use UIWebView so I can control the layout of text I've
I'm trying to understand some memory issues concerning AVAudioPlayer and AVAudioRecorder. I create an

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.