data binding - WPF controls, disable changes to `SelectedItem` when bound property to `ItemsSource` changes -


when use combobox or other controls have itemssource , selecteditem property bindings each time upon initial binding during runtime , each time when bound collection itemssource changes experience content of bound selecteditem object changed.

how can disable this?

for example:

i have <combobox minwidth="300" itemssource="{binding availablemasters}" selecteditem="{binding selectedmaster}">

when run application selectedmaster property assigned first item in availablemasters. also, each time availablemasters collection changes (for example, assigning new collection property) selectedmaster again adjusted.

the desired behavior selecteditem (selectedmaster) populated/changed when end-user clicks mouse on item / chooses item combobox or other control.

set flag/bool property before update collection , use in selectedmaster property. or need xaml solution?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -