wpf - Expander inside ListBox not showing content when expanded the first time from binding -
i have dialog window contains listbox itemtemplate contains expander. isexpanded bound property in item view model. listboxitem 's isselected property bound isexpanded property in item view model object. , selecteditem property of listbox bound property same name in view model. the problem here when setting view model before showing dialog , setting datacontext of dialog, item in listbox gets selected should, expander arrow shows in expanded state, content of expander not displayed. if set view model after showing dialog, eg. in loaded handler of dialog things work expected. going on here, , best way fix it? the dialog window defined as: <window x:class="wpfapplication1.dialog" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:l="clr-namespace:wpfapplication1" title="dialog" height="300" width=...