English 中文(简体)
印刷银星4号中的合成数据
原标题:Printing async data from Silverlight 4

我在这里有鸡蛋问题。

我想印刷地图数据,从一个网络服务中 as取。 问题在于,我不知道选定的纸面尺寸(影响到我要求服务的地图的大小),直到印刷方言和印刷活动上使用方的K。

我认为,唯一一点是“暂停”印刷活动中间的整个印刷过程,检索地图图象,将目前的页数与地图图象挂钩,然后让印刷过程继续下去。 但这似乎不是可能的,也不是“正确”。

我认为,在印刷之前,用户从压缩机箱中选择一个页数(这样,我才能检索适当的图像规模,并且只有在检索所有地图数据之后才能使“印数”纽吨。 但是,用户需要两次从我的bo子盒中挑选一页,一次从印刷方言中挑选。 如果他们从 com贝箱中挑选了11x17人,然后在印刷方言上只禁用K(很有可能),就会在8.5x11纸纸面上打印出11x17条布局。

我发现的这个问题的唯一其它提到是。 http://betaforums.silverlight.net/forums/p/192371/444897.aspx,他们也没有找到解决办法。

最佳回答

这一问题没有直接的解决办法。 印刷发动机在此负责,并要求下页视像。 从开发商的观点来看,一个更好的模式是将事件转化为方法,并且有《守则》(<>strong>(>>>/code>。 我确信,这样做有难以解决的技术原因。

我认为,你们有两种选择。 一种做法是简单地阻挡在<代码>PrintPage的路面,同时等待同步运行。 我不相信我会说,但在这种情况下,它是合理的。 类似:

 using(var waitHandle = new AutoResetEvent(false))
 {
      // Some intial code
      var result = YourAsyncOperation(parametersNeeded, () => waitHandle.set());
      bool signaled = waitHandle.WaitOne(30000);  // 30
      // Conitnue as appropriate (result might be indicate an error, signaled might be false indicating a timeout). 
 }

你的另一种选择是,确保你有足够的数据用户支持银星代码,以便完成布局工作。

问题回答

你可以推迟印刷。

   void p_PrintPage(object sender, PrintPageEventArgs e)
    {
        if (isLoadedMap())
        {
           e.PageVisual = null;
           e.HasMorePages = true;
        } else {
           e
        }
    }




相关问题
Silverlight Rich text box control

Our team decided that we need our own custom Rich text box control for Silverlight app we are developing. We looked at existing controls mentioned at A good rich text control for Silverlight but ...

Silverlight ImageBrush not rendering (with Bing Map Control)

I m trying to add an image to a Pushpin instance from the Silverlight Bing Map Control, but I can t seem to get it to render (the pushpin renders fine). This is probably a general WPF question rather ...

Silverlight OpenFileDialog DoEvents equivalent

I m processing large files after they are selected by the user. My code looks like the following: if (FileDialog.ShowDialog() == true) { // process really big file } This freezes up the UI so ...

list of controls with templates in silverlight

Does anyone know where to find a list of controls that you can set the template on in Silverlight? I ve wasted several hours now trying to create control templates only to find that the control doesn ...

Silverlight, Updating the UI during processing

I have a simple silverlight multifile upload application, and i want to provide the user with some feedback, right now its only in a test phase and i dont have the webservice. Somehow i cant get the ...

Silverlight 3 - FindName returns null

This looks a bug to me.. Using Silverlight 3 and i have a user control defined in XAML and trying to access the object during runtime returns a null. <Grid> <common:CommonGridEditPanel x:...

silverlight 3 collection binding

Someone please help me understand why this binding does not work... I have a class called SelectionManager with a property called dates which is populated by a WCF service. The property is an ...

热门标签