I have what I assume is a common problem. I have a textbox. It is bound to a property. Here's the Xaml
<TextBoxGrid.Row="13"Grid.Column="1"Name="tbVehicleColor"Text="{BindingPath=NewVehicle.VehicleColor}"></TextBox>
The user is typing the color of a car into a textbox. No problem. Then, I decided that was too much work, so I used a combobox to present a list of common car colors. When the user selects a color from the dropdown, the textbox gets set. (via tbVehicleColor.Text=(string) comboBoxForColors.SelectedItem; )
Suddenly - no binding.After some googling, lots of people have similar problems, and it seems there are lots and lots of answers, all of them just a little crazy.
It seems like the source of the problem must be that it only rebinds after a control loses focus, but of course the control never has focus, so no rebinding. However, I have seen variations on this, and lots of solutions that seem to work but only under exactly the right circumstances. Is there a "right" way to do this? All of the various force focus to wander about seem, well, contrived. They seem like the sort of thing that someone banged on his keyboard for a while and managed to hit just the right combination to get lucky. If I were filling in quite a few text boxes based on the result of combo box hit, would I have to wander around the form moving the focus from one place to another?
What really worries me is that some of my controls have forced behviors that occur when they either get or lose focus. If I have to focus them in order to get the databinding to work, I'll be in a pickle.