Silverlight 中的 CSS 样式
我知道在 SL 中可以设置样式,但我有一个大型 Web 应用程序,它同时具有 HTML 和 SL,因此如果它们可以使用相同的样式表,那将非常有用...... 是否可以? 谢谢。
I know styling is possible in SL, but I have a large web app that has both HTML and SL so it would be really useful if they could use the same style sheet...
Is it possible?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不得不说不。如果没有其他原因,就是 Microsoft 在 CSS 方面的糟糕记录(即使是他们领先的浏览器一代也比竞争对手的 CSS 实现落后了 10 年)。 Word/Outlook 引擎在 CSS 方面表现很糟糕。如果 silverlight 支持 CSS,你可以打赌这将是狗的早餐。
另一方面,SVG 支持 CSS,因此您可能需要将其作为替代方案。
I would have to say no. If for no other reason than Microsoft's poor track record in regards to CSS (even their leading browser generation is 10 years behind competing CSS implementations). The Word/Outlook engine is atrocious at CSS. If silverlight supports CSS you can bet it'll be a dog's breakfast.
On the other hand SVG supports CSS so you might want to look into that as an alternative.
Silverlight 是一个 Web 应用程序,而不是一个 Web 表单。您必须使用 Resource.XAML 文件才能将样式应用到您的 Silverlight 应用程序。
Silverlight is a Web application and not a Web form. You'd have to use the Resource.XAML file in order to apply styling to your Silverlight application.
遗憾的是 CSS 和 XAML 不兼容。在 Silverlight 中,“样式表”称为 ResourceDictionaries,位于 Silverlight 项目中。
我创建了一个免费的 Silverlight 主题,其中有多个 ResourceDictionaries,一个用于颜色 (Brushes.xaml),一个用于设置控件样式,可能值得下载该项目以了解其工作原理:http://www.blackspike.com/site/silverlight/free-silverlight-4-beta-skin< /a>
CSS and XAML are incompatible sadly. In Silverlight 'Stylesheets' are called ResourceDictionaries, which live in the Silverlight Project.
I created a free Silverlight theme which has several ResourceDictionaries, one for the colours (Brushes.xaml) and one to style the controls, it might be worth downloading the project to see how it works: http://www.blackspike.com/site/silverlight/free-silverlight-4-beta-skin