I've a small WPF application(.Net 3.5 :/ ).
In this application I've a listbox, which allows me to select an element to edit on the right part of the application.
If the right part is invalid, I need to prevent the user changing the selection of elements.
I've made a lot of search on this: Some were telling to change the background/brush to make it look like the selection is not possible(but the selection is still possible)
Some other were telling me to update the IsFocusable property of sub elements:
<ListBox itemsSoutces={Binding Test}>
<ListBoxt.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Focusable" Value="False"/>
</Style>
</listBox.ItemContainerStyle>
</ListBox>
The problem with this solution is that this value has to comes from a value of my ViewModel, and I don't know(nor it's possible) to bind the Value of the Style Setter to a property of my ViewModel?
Is it possible? How?
IsEnabled = false
)? – Daniel Hilgarth