重新编译Silverlight到WPF问题 [英] Recompile Silverlight to WPF issues

查看:222
本文介绍了重新编译Silverlight到WPF问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Silverlight控件,我需要转换为WPF
(是的,我知道这不明智,没有选择)
我知道有些程序集需要改变。
这是此问题的后续跟进 a>

I have a Silverlight control i need to convert to WPF (Yes, i know that's not wise, don't have a choice) And i am aware that some assemblies need to be changed. this is a follow up of this question

现在我可以肯定,我在这里失去了一件大事。
DId真的不知道如何做,所以我刚开始复制所有的cs文件代码到新的
类项目。
现在我得到所有的怪异的错误。
对于程序集的缺失(ofcourse),
现在我不能理解的是我错过了非常基本的东西,我正在调用正确的人我相信。我在其他WPF应用程序中使用的东西。
for isntance我得到的父类的错误:
Point,Size,UIElement,DependencyProperty,MouseEventHandler等。

Now i am kinda sure that i'm missing a big thing here. DIdn't really know how to do that so i just started copying all the cs files code to new class project. Now i get all kind of weirds errors. Most for assemblies missing ( ofcourse), Now what i fail to understand is i'm missing very basic stuff and i am calling the right ones i belive. stuff i used in other WPF applications. for isntance i get Errors for theese classes : Point, Size, UIElement, DependencyProperty, MouseEventHandler etc.

现在项目只有14个类,没有主文件或任何东西,这可以相关吗?

无论如何,我使用这个代码调用程序集(在任何地方相同):

Anyway, i'm using this code to call assemblies (preety much the same anywhere):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Text;
using System.Threading;
using System.ComponentModel;
using System.Globalization;
using System.Diagnostics.CodeAnalysis;

VS不会帮我任何装配我可以调用,只是选项生成我自己的类。

And the VS isn't givining me on help any assembly i could call, just the option to generate my own class.

我使用VS 2010定位Framework 4.0

I am targeting Framework 4.0 using VS 2010

帮助!

推荐答案

你把这个控件放在一个新的WPF项目中吗?如果您确实添加了这些引用

Did you put this control in a new WPF project? If you didnt make sure you add these References


  • PresentationFramework

  • PresentationCore

  • WindowsBase

  • System.Xaml

  • PresentationFramework
  • PresentationCore
  • WindowsBase
  • System.Xaml

然后删除所有使用的语句

Then remove all your using Statements and readd them all.

您也可能需要


  • System.Drawing取决于您使用的点

这篇关于重新编译Silverlight到WPF问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆