0

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

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

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

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.

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?

Please help guys, Sincerly yours, Eric

2
  • SilverLight and WPF UI controls were not interchangeable and Microsoft is very clear on that. Look for a WPF control that does what you need. If you are new to WPF and .NET then converting a control is not a good first project. Commented Feb 16, 2012 at 20:52
  • Problem is, there isn't a good one =/ Commented Feb 16, 2012 at 20:56

1 Answer 1

6

You can't.

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.

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.

Sign up to request clarification or add additional context in comments.

7 Comments

But the error isn't pointing out where in code i can change the referance. Got a clue?
@eric.itzhak - are you just trying to reference the Silverlight control as already built or are you trying to recompile the source?
I'm not sure i understood the question. I want to be able to use that control in a WPF. as the controls are referancing silverlight, isn't my only option to recompile the source to create a dll? i don't know of any other way to referance to controls. asked that as well at the question above.
@eric.itzhak - yes you have to recompile the source against the WPF libraries. There will be differences.
Ya trying to that for the past hour. seems to be too many changes and not enough information on web. System.Windows should be changed to what? and where can i find TemplateVisualState in WPF?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.