一、文本框绑定以及获取文本值
1.首先创建一个类来存储各个文本值
public public class ClassViewModel
{
private string _txtValue;
public string TxtValue
{ get { return _txtValue; }
set { _txtValue = value; }
}
}
前台用一个silverlight的文本控件用Binding绑定对应的值
<TextBox
TextWrapping="Wrap"
Text="{Binding TxtValue}"
AcceptsReturn="True"
FontSize="15"
FontWeight="Bold"
Background="BurlyWood"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto" SelectionBackground="#FFDBCAEF"
/>