jeudi 5 novembre 2015

Is it neccessary to create a converter for simply true/false operations?

I asked about binding to a control and learned that I can bind to ElementName. So I did. However, I notice that I'll need to revert the value of being selected. Is there a way to do that without a converter?

<DatePicker Name="EndDate"
            Text="{Binding Path=EndDate}"
            IsEnabled="{Binding ElementName=NoEndDate,Path=IsChecked}" />
<CheckBox Name="NoEndDate"
          Checked="CbTillsVidare_OnChecked"
          Unchecked="CbTillsVidare_OnUnchecked" />

I wish to set enabled when the path of NoEndDate is false and vice versa.

Aucun commentaire:

Enregistrer un commentaire