Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: CheckListBox SelectedItemsOverride binding not working

$
0
0
I have a problem with getting the CheckListBox SelectedItemsOverride set binding to work.
The get binding (on my SelectedTaskStatuses) is called correctly during initialization but set is never called when items in my CheckListBox are selected/unselected.

Any ideas what I am doing wrong ?

Using toolkit version 2.3.0.0 community edition

For test purposes I also made a binding for Command and this works OK.

XAML:

<xctk:CheckListBox
Command="{Binding SelectCommand}"
ItemsSource="{Binding TaskStatuses}"
SelectedItemsOverride="{Binding SelectedTaskStatuses,
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}"/>

Code behind:
    private ObservableCollection<String> taskStatuses;
    public ObservableCollection<String> TaskStatuses
    {
        get
        {
            return new ObservableCollection<string>()
    {
        "string1", 
        "string2", 
        "string3", 
        "string4", 
        "string5",
        "string6",
        "string7",
        "string8",
        "string9"
    };
    }
        set { taskStatuses = value; }
    }

    private ObservableCollection<String> selectedTaskStatuses;
    public ObservableCollection<String> SelectedTaskStatuses
    {
        get
        {
            return new ObservableCollection<string>();
        }
        set 
        { 
            selectedTaskStatuses = value; 
        }
    }

    private ICommand selectCommand;
    public ICommand SelectCommand
    {
        get
        {
            return selectCommand ?? (selectCommand = new CommandHandler(() => MyAction(), canExecute));
        }
    }

    private bool canExecute;
    public void MyAction()
    {
    }

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>