Patrick Fromberg
Patrick Fromberg

Reputation: 1407

Howto initialize a OneWayToSource property in XAML

   <dxe:CheckEdit x:Name="something" 
                  IsChecked="{Binding IsSomething, 
                              Mode=OneWayToSource, 
                              UpdateSourceTrigger=PropertyChanged}"/>

I want property IsChecked to be initialized with True.

I can not do it in my ViewModel.

I do not want to do it in my code behind.

I do not know how to do it in XAML but I believe it is the correct place to do so.

Upvotes: 0

Views: 373

Answers (1)

mm8
mm8

Reputation: 169340

Try to set the Fallback value of the Binding to True:

<dxe:CheckEdit x:Name="something" IsChecked="{Binding IsSomething, 
                              Mode=OneWayToSource, 
                              UpdateSourceTrigger=PropertyChanged, FallbackValue=True}"/>

Upvotes: 3

Related Questions