lundi 30 septembre 2019

Add elements in a list when clicking in a checkbox without code-behind

I have a list of checkbox :

<ListBox Name="listBoxZone" ItemsSource="{Binding FilesInDirectories}"  Height="115" Background="Azure" SelectionMode="Multiple">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <CheckBox Name="CheckBoxZone" Margin="0,5,0,0" Content="{Binding}" Checked="{}"/>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>

I want to add the checked elements in a list in my ViewModel.

I don't want to use the code behind and the event : clicked.

Is it possible ?

How can I do this ?




Aucun commentaire:

Enregistrer un commentaire