dimanche 31 janvier 2016

CheckBox text to change based on its IsChecked

I want a CheckBox text to changed based on the IsChecked status.

Tried with the following, but it complains about not having the property Content

                <CheckBox Name="IsManualInput" IsChecked="{Binding Path=IsManualInputExclusion, Mode=TwoWay}" >
                    <CheckBox.Style>
                        <Style>
                            <Style.Triggers>
                                <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" Value="True" >
                                    <Setter Property="Content" Value="Manual" />
                                    <Setter Property="IsReadOnly" Value="True"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" Value="True" >
                                    <Setter Property="Content" Value="Define exclusion(s) manually.." />
                                    <Setter Property="IsReadOnly" Value="True"/>
                                </DataTrigger>
                            </Style.Triggers>
                        </Style>
                    </CheckBox.Style>
                </CheckBox>




Aucun commentaire:

Enregistrer un commentaire