如何将Silverlight控件添加到WPF解决方案?

编程入门 行业动态 更新时间:2024-10-27 00:32:53
本文介绍了如何将Silverlight控件添加到WPF解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我一般来说对WPF和.Net编程还是有点陌生​​。 我已经下载了此源代码。

I'm kinda new to WPF and .Net programming in general. I have downloaded this Source Code.

现在,它有一个包含Paris.Controls csproj的解决方案。

Now, it has a solution which contains a Paris.Controls csproj.

这是最初为Silverlight制作的,当我尝试添加时引用这些控件的输出dll,我得到一个错误:

This was originaly made for Silverlight, when i try to add referance to the outputed dll of those controls, i get an error:

Error 1 Unknown build error, 'Cannot resolve dependency to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event. Line 9 Position 80.' C:\Users\Eric\Documents\Visual Studio 2010\Projects\WpfApplication1\WpfApplication1\MainWindow.xaml 9 80 WpfApplication1

经过一番谷歌搜索后,由于Silverlight-WPF转换,我发现这是最喜欢的方式。 Silverlight使用的引用不同于WPF。 我认为这有点愚蠢,因为据我了解,Silverlight是WPF的减法,但没关系。

After a bit of googling, i found out It's most likley because of the Silverlight - WPF transformation. That Silverlight uses different referances then WPF. Which is kinda dumb i think because as i understood Silverlight is a substraction of WPF, but nevermind.

所以我的问题是我应该怎么做,怎么办? 我应该编辑Paris.Controls并将其设置为WPF可用吗? 更改推荐人之类的东西?如果那是我应该做的,我该怎么做? 如果没有,我有什么选择?

So my question is what should i do and how? Should i edit the Paris.Controls and make it WPF-Available? Change referances and stuff like that? and if that's what i should do, How do i do that? And if not, what are my options?

请帮助大家,真诚的帮助您, Eric

Please help guys, Sincerly yours, Eric

推荐答案

您不能。

Silverlight和WPF虽然非常相似,但它们基于.NET运行时的不同版本。 WPF使用完整版本,而Silverlight使用针对Internet优化的轻量级版本。

Silverlight and WPF, while very similar are based on different versions of the .NET runtime. WPF uses the full version, while Silverlight uses a lighterweight version optimised for the Internet.

有了源代码,您应该可以将其合并到WPF控件中-这将意味着针对完整的库进行重新编译,并修复编译器抛出的所有错误。

As you have the source code you should be able to incorporate that into a WPF control - it will mean recompiling against the full libraries and fixing any errors that the compiler throws up.

更多推荐

如何将Silverlight控件添加到WPF解决方案?

本文发布于:2023-11-01 23:34:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550729.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   如何将   解决方案   Silverlight   WPF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!