In my application, I have a details screen that displays both a DateTime Picker as well as a number of comboboxes. When I open the application and select an item from a list to open the detail screen, the controls work fine. When I open the application from a command-line argument using the same code to open the detail screen, the comboboxes and datetime picker do not expand when you click the down arrow. This control is bound to its viewmodel.
I have tried firing the INotifyPropertyChanged event manually as well as trying to have the control refresh by calling myCombobox.GetBindingExpression(ComboBox.ItemsSourceProperty).UpdateTarget(); in the control’s Loaded event.
Calling the control’s UpdateLayout() does not resolve the issue when called in the Loaded event. Calling the combo-box’s UpdateLayout() method in the Loaded event does not resolve the issue. I’ve also tried the same method calls in the Initialized event but without success.
Any advice is greatly appreciated.
As mentioned in the diagnosis above, this appears to have been an issue of timing of screens being rendered. It turns out that if I handle the command-line parameters in the main window’s ContentRendered event, the resulting screen’s comboboxes end up displaying appropriately.