Hello,
We are
using RadListBox as part of UserControl. Control consists of couple of data
templates one of which contains list box:
<
telerik:RadListBox
Grid.Row
=
"2"
x:Name
=
"DocumentListBox"
ItemsSource
=
"{Binding ItemsView}"
BorderThickness
=
"0"
ItemTemplateSelector
=
"{Binding TemplateSelector}"
SelectedItem
=
"{Binding SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Background
=
"Transparent"
HorizontalContentAlignment
=
"Stretch"
SelectionMode
=
"Single"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
ScrollViewer.HorizontalScrollBarVisibility
=
"Disabled"
ScrollViewer.IsDeferredScrollingEnabled
=
"{Binding IsDeferredScrollingEnabled}"
>
<
telerik:EventToCommandBehavior.EventBindings
>
<
telerik:EventBinding
EventName
=
"MouseDoubleClick"
Command
=
"{Binding OpenItemCommand}"
CommandParameter
=
"{Binding SelectedItem}"
/>
</
telerik:EventToCommandBehavior.EventBindings
>
<
telerik:RadListBox.ItemContainerStyle
>
<
Style
TargetType
=
"telerik:RadListBoxItem"
BasedOn
=
"{StaticResource {x:Type telerik:RadListBoxItem}}"
>
<
EventSetter
Event
=
"MouseMove"
Handler
=
"DocumentListBox_OnMouseMove"
/>
</
Style
>
</
telerik:RadListBox.ItemContainerStyle
>
<
telerik:RadListBox.InputBindings
>
<
KeyBinding
Key
=
"Delete"
Command
=
"{Binding DeleteItemCommand}"
CommandParameter
=
"{Binding SelectedItem}"
/>
<
KeyBinding
Modifiers
=
"Control"
Key
=
"O"
Command
=
"{Binding OpenItemCommand}"
CommandParameter
=
"{Binding SelectedItem}"
/>
</
telerik:RadListBox.InputBindings
>
</
telerik:RadListBox
>
Control always used with the same view model. Most of the times SelectedItem binding works fine. But in two places it doesn't.
There is no binding related errors in the output, RadListBox is correctly populated with items and RadListBox.SelectedItem has correct value.
But in this two problematic cases SelectedItem property of the view model does not get updated.
We suspect that the problem might have something to do with the initialization order, but could not detect any specific pattern.
In one case the control used in the tab in the other in dialog window.