Code Monkey home page Code Monkey logo

Comments (7)

GWawrzeniecki avatar GWawrzeniecki commented on June 12, 2024 1

Oh indeed. But in my use case I don't select items from code.

from timswpfcontrols.

timunie avatar timunie commented on June 12, 2024

Hi @GWawrzeniecki

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 😢

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.

GWawrzeniecki avatar GWawrzeniecki commented on June 12, 2024

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.

timunie avatar timunie commented on June 12, 2024

@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.

timunie avatar timunie commented on June 12, 2024

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.

GWawrzeniecki avatar GWawrzeniecki commented on June 12, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.