Comments (7)
Oh indeed. But in my use case I don't select items from code.
from timswpfcontrols.
Seems like this is a bug comming from WPF itself. I tried several ways on my own but didn't find a solution so far
- use
DataTemplate
► Same issue you have - use
ItemContainerStyle
► works in 70 % of the cases, but not always. Does not work if thePopup
was not shown first. Nothing to do here - searching the web gave me: https://stackoverflow.com/questions/12466967/listbox-isselected-databinding-in-datatemplate
My conclusion is that we need to manually add / remove this in MultiSelectionComboBox.SelectedItems
until I found a solution.
Note: I am transferring this control to MahApps. Maybe someone there will have a solution.
Happy coding
Tim
from timswpfcontrols.
Hi @timunie
At first, Thank you very much for your time!
I manged to resolve it with following code!
'<controls:MultiSelectionComboBox.Resources>
<Style TargetType="ListBoxItem">
<Setter Property="IsSelected"
Value="{Binding IsChecked, Mode=TwoWay}" />
</Style>
</controls:MultiSelectionComboBox.Resources>'
from timswpfcontrols.
@GWawrzeniecki Be aware that this does not work in every case! Try to select an item in your model on start up- You may notice that it does not work.
from timswpfcontrols.
That is what I would like to do, so in my case I need to handle it differently. At least I have to state this in the docs for the new implementation on MahApps.
from timswpfcontrols.
Here you are a few another solutions https://stackoverflow.com/questions/9880589/bind-to-selecteditems-from-datagrid-or-listbox-in-mvvm
Maybe one of them will suit your needs
from timswpfcontrols.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timswpfcontrols.