xaml - Slider control shows abnormal behaviour on {Binding} with TextBlock -
sorry if title weird , because problem kinda weird.
i have textblock , slider control on clientside.
the slider {binding} textblock.
this code them -
<textblock text="{binding value}" x:name="name1value" fontsize="25"/> <slider valuechanged="slider_valuechanged_1" x:name="slidervalve" value= "{binding elementname=name1value,path=text}" stepfrequency="25" />
now when slider value changes,slider calls method slider_valuechanged_1,which sends value server. server accepts value , sends new value client , new value server set textblock( x:name="name1value") through observablecollection inotifypropertychanged implemented. slider {binding} textblock.
1)now first time change value on slider on client, server accepts new value , returns new value , setting new value textblock. 2)now changing value on server , value correctly updated in textblock , slider value changes textblock value.
3) now after first cycle,if change value on server again ,the textblock on client getting updated slider not change textblock value.
but slider bound textblock. how can solve this?
edit1: fyi , textblock , slider in same page in different stackpanels
a slider
control's value
property of type double
, while textblock.text
string. binding these 2 without converter asking trouble. should bind slider.value
datacontext
/view model , typically make sure binding mode=twoway
.
Comments
Post a Comment