Silverlight 自定义启动屏幕中的进度条
如何将 Silverlight ProgressBar 控件嵌入到自定义启动屏幕中? 我将以下内容放入松散的xaml中(为简洁起见,进行了简化):
<Grid xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ProgressBar />
</Grid>
错误消息如下: 错误:Silverlight 应用程序中未处理的错误 代码:2007
类别:解析器错误
消息:未知元素:ProgressBar。
等等
ProgressBar 不是 http://schemas.microsoft.com/winfx/2006/xaml/presentation 命名空间?
How does one embed the Silverlight ProgressBar control in a a custom splash screen? I put the following into loose xaml (simplified for brevity):
<Grid xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ProgressBar />
</Grid>
The error message is as follows:
Error: Unhandled Error in Silverlight Application
Code: 2007
Category: ParserError
Message: Unknown element: ProgressBar.
etc
Isn't the ProgressBar a standard control defined in the http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设是 SL2 或 SL3,因为进度条的存在 - 它已添加到 SL2 中。
/winfx/2006/xaml/presentation 名称空间未声明 - 但肯定在它所在的 SL2/3 中。 您已使用替代方案 http://schemas.microsoft.com/client/2007,此是 SL1.0 的遗留命名空间
给出的代码可以工作,但要重现,我必须将根元素作为用户控件,并且命名空间必须驻留在其中,否则用户控件标记本身将无法被识别。
在 SL3 中表现良好。
您能否发布更多页面、根元素、更新对 SL2/3 命名空间的引用,并说明正在使用哪个 SL 版本?
I'm assuming SL2 or SL3 since the presence of a progress bar - it got added in SL2.
The /winfx/2006/xaml/presentation name space isn't declared - but certainly in SL2/3 that is where it resides. You have used the alternative http://schemas.microsoft.com/client/2007, this is a legacy namespace for SL1.0
The code given will work, but to reproduce I have to have the root element as a user control and the namespaces have to reside in there, otherwise the usercontrol tag itself is not recognised.
Worked fine in SL3.
Can you post more of the page, root element, update the reference to the SL2/3 namespace and also say which verison of SL is being used?
如果这是针对对象标记的 SplashScreenSource 属性,则 XAML 必须是 Silverlight 1+JavaScript(非托管 XAML),具体操作方法如下:(摘自 Silverlight SDK 此处)
然后使用 JS 函数来更新进度:
If this is for the SplashScreenSource property of the object tag, then the XAML must be Silverlight 1+JavaScript (non-managed XAML) Here is how you would do that: (Taken from the Silverlight SDK here)
And then use a JS function to update the progress: