【发布时间】:2014-08-13 07:01:57
【问题描述】:
我是 Silver Light 的新手,我在 datagrid 上有一个按钮,带有打开 PopUp 窗口的链接 这就是我打开弹出窗口的方式
MyChildPage view = new MyChildPage("123");
view.Show();
在我的页面的构造函数中,我从数据库中获取数据,这就是我在 MyChild 页面中所做的事情
public MyChildPage(string id)
{
InitializeComponent();
LoadData(id);
client.GetDataCompleted +=
new EventHandler<GetDataCompletedEventArgs>(client_GetDataCompleted);
}
private void LoadData(string Id)
{
client.GetLeadsforUnResolvedAsync(policyId);
}
void client_GetDataCompleted(object sender, GetDataCompletedEventArgs e)
{
if (e.Error == null)
{
if (e.Result != null)
{
DatatoLoad = e.Result;
}
}
}
private MyClass _data;
public MyClass DatatoLoad
{
get { return _data; }
set { _data = value; }
}
这是我的 XAML
<TextBlock Text="Name" Style="{StaticResource FieldHeadingStyle}"
HorizontalAlignment="Left" VerticalAlignment="Top"
Margin="12,29,0,0" Width="67" />
<TextBox x:Name="DatatoLoad_Name"
VerticalAlignment="Top" HorizontalContentAlignment="Stretch"
Margin="12,51,100,0" TabIndex="4"/>
<TextBox x:Name="DatatoLoad_Details"
HorizontalContentAlignment="Stretch" Margin="12,98,100,0"
TabIndex="4" VerticalAlignment="Top" />
但数据没有加载到文本框中,我尝试调试代码并正确返回数据,我在 GetDataCompleted 事件上设置断点,数据出现在 DatatoLoad 但填充文本框,可能是什么问题以及如何可以修吗?
【问题讨论】:
标签: c# wcf silverlight