【发布时间】:2011-01-11 14:07:28
【问题描述】:
希望标题有意义,但我会描述我的问题。当 UI 执行某些工作时,我在 Silverlight 中使用子窗口来显示处理消息和旋转图像。一旦调用了 Completed Event,窗口就会关闭。
问题是当 UI 执行快速任务时,它看起来确实有点难看,因为子窗口打开然后在 1 秒内关闭。
我想要做的是仅在处理 2 秒后才打开子窗口,然后在完成时关闭。
我添加了我的 xaml 的一部分,我在下面调用孩子。我已经搜索过,但在这方面找不到任何东西,而且可能是不可能的。
void edit_Closed(object sender, EventArgs e) { EditChannelDetails edit = 作为 EditChannelDetails 的发件人;
if (edit.DialogResult == true)
{
if (edit != null)
{
Channel edited = new Channel();
edited.channelId = Int32.Parse(edit.ChannelID.Text);
edited.name = edit.ChannelName.Text;
edited.description = edit.ChannelDescription.Text;
ChannelClient proxy = new ChannelClient(new BasicHttpBinding(), new EndpointAddress("http://servername"));
proxy.UpdateChannelCompleted += new EventHandler<UpdateChannelCompletedEventArgs>(proxy_UpdateChannelCompleted);
proxy.UpdateChannelAsync(edited);
}
}
processingDialog.Show();
}
void proxy_UpdateChannelCompleted(object sender, UpdateChannelCompletedEventArgs e)
{
processingDialog.Close();
等等……
【问题讨论】: