dimanche 10 janvier 2016

Uncheck selected checkbox programmatically

I've a checkbox which defined as below:

<GridViewColumn>
  <GridViewColumn.CellTemplate>
    <DataTemplate>
      <CheckBox x:Name="CampaignCb" Tag="{Binding Campaign}" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListViewItem}}, Path=IsSelected}" Checked="CampaignCb_Checked" Unchecked="CampaignCb_Unchecked" />
    </DataTemplate>
  </GridViewColumn.CellTemplate>
</GridViewColumn>

How can I unchecked the selected checkbox programmatically? I've try with CampaignCb.IsChecked = false but it doesn't work for my case since my checkbox is bound to a source.




Aucun commentaire:

Enregistrer un commentaire