我看你说的内容写了一个示例出来:
前台:
<UserControl x:Class="SilverlightApplication22.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
<Grid x:Name="LayoutRoot">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBox x:Name="txtIdTest" Text="{Binding OrganizationId,Mode=TwoWay}" Grid.Row="0"/>
<Button x:Name="btnGetId" Grid.Row="1" Click="btnGetId_Click"/>
<TextBlock x:Name="txtShowId" Grid.Row="2"/>
</Grid>
</UserControl>
后台:
namespace SilverlightApplication22
{
public partial class MainPage : UserControl
{
//注意这里一定要有getter和setter
public String OrganizationId { get; set; }
public MainPage()
{
InitializeComponent();
//需要把当前对象放到DataContext上
this.txtIdTest.DataContext = this;
//前台应该要注意使用Mode=TwoWay
}
private void btnGetId_Click(object sender, RoutedEventArgs e)
{
this.txtShowId.Text = OrganizationId;
}
}
}
努力!完成了js解析器,还差一个svg插件,一个绘图程序,做好自己,呵呵~!