c# - WPF two-way binding -
i have textbox property fontsize = "12" , slider, , not remember how use command = mode twoway , when moving slider resize text of textbox.
here leave code trying use not work me
<textbox x:name="textbox1" margin="16,16,16,49" textwrapping="wrap" isreadonly="true" verticalscrollbarvisibility="auto" fontsize="12" /> <slider x:name="slider" horizontalalignment="left" margin="20,78,0,-1" width="166" maximum="50" minimum="12" value="{binding path=textbox1.fontsize,mode=twoway}" />
try this, i.e. bind value of slider fontsize property of textbox using elementname.
<textbox x:name="textbox1" margin="16,16,16,49" textwrapping="wrap" isreadonly="true" verticalscrollbarvisibility="auto" fontsize="12" /> <slider x:name="slider" horizontalalignment="left" margin="20,78,0,-1" width="166" maximum="50" minimum="12" value="{binding path=fontsize, elementname=textbox1}" />
Comments
Post a Comment