I’ve got a simple question, I’ve got a ComboBox whose ItemsSource is bound to a relatively expensive service call.
If I have the ComboBox in question disabled will the binding still fire? If so what I can I do to ensure that the expensive call is only made when it really needs to be?
You probably want to at least consider modifying the template for the
ComboBoxso that it uses aVirtualizingStackPanel, at least, as long as your service call fetches items one at a time. See this for a pretty good discussion of the issues.Edit
To answer your actual question: no, disabling the
ComboBoxdoesn’t stop it from populating its items. I determined this by implementing a collection class, binding aComboBox‘sItemsSourceto an instance of it, and watching it service its method calls. Its items get retrieved if theComboBoxis enabled. They even get retrieved if itsVisibilityisCollapsed. I’m pretty surprised; that’s not what I would have expected at all.