c# - WPF Binding TwoWay not working, OneWayToSource working. WHY? -
i have control dependencyproperty of type timespan. when try bind property, value not being updated.
usage of control:
<controls:timecontrol time={binding sometimespanproperty} />
when change value of time in control, change not updated in sometimespanproperty. however, if change {binding sometimespanproperty} {binding sometimespanproperty,mode=onewaytosource}, updated.
i found solution. if reading in future wants know it:
i had explicitly set mode of binding twoway, because default binding mode timespan type property oneway.
from this:
<controls:timecontrol time={binding sometimespanproperty} />
to this:
<controls:timecontrol time={binding sometimespanproperty,mode=twoway} />
and works!
Comments
Post a Comment