WPF - Windows Forms Interoperation - wpf

I am abit confused about interoperations between forms. I have an c#.Net application developed using DevExforms. On the other hand I have a XNA application which I want to use it as 3d GUI. But it is diffucult to interact between them. Of course it is not useful, it is ugly too.
So I see a way to develop 3d model viewer app using WPF but WPF controls and windows forms controls needs .Net Framework 4.5 to interact betwwen. But I must use VS2010.
So I am confused. What must I do. How can I easily develop a 3d app with Windows Forms or how can i interact any platform with my app. Actualy if you were me what will you do?

WPF controls and WinForms controls don't need .Net framework 4.5 to work together. the interoperability exists before (4.5). take a look in MSDN

Related

WinRT and WPF in Windows 8

As I understand, WinRT is a different version of WPF written without using the underlying Win32 APIs.
What's the relation of WinRT and WPF? Will WPF work under Metro in Windows 7 or will it launch the classic desktop?
That's not so clear from the Keynote. If someone has Windows 8 installed can confirm it's behaviour.
Thanks
WinRT is a replacement for the Winapi. The api is native, very unlike WPF that runs as a layer on top of the CLR. It certainly resembles WPF, part of what causes confusion. It adopted the metadata format of managed code, replacing type libraries of old. And uses XAML for UI designs, much like WPF, Silverlight and Windows Phone. You can still write WPF apps for Windows 8 but your app can't be published through the store, won't integrate with the Metro desktop nor will it run on tablets that are based on the ARM core. Whether that's a real problem depends a great deal on how well Metro will do in the market place.
There is no relation between WPF and WinRT, just like there is no relation between Silverlight and WPF. Now we have three technologies, WPF, Silverlight and WinRT.
If you try to execute WPF application, it will not execute on Metro, it will execute in the classical desktop only.
In Visual Studio 2011, you have WPF and Metro as two different types of applications, and Xaml for WPF and WinRT is not same, Xaml for WinRT is pretty much same as that of Silverlight as lot of classes which exist for WPF are missing in WinRT library. But most of classes that exist for Silverlight are available in WinRT.
Windows Runtime (WinRT) is an alternative API used to create Metro Applications
(and later server application).
The APIs are class/method/struct based and surfaced to .Net metro apps, html5/css3/javascript apps and C/C++ metro applications.
The implementation is native.
APIs are made visible via .winmd files, which contain metadata very similar to the metadata you have in .Net assemblies.
The APIs are designed to secure and async friendly with many APIs requiring the use of async/await due to them potentially taking more than 50msec to execute.
It includes a subset of Win32 APIs and COM apis.
Anyway... the followings links help... channel9 also has some //Build/ videos on the subject..
Metro style app development
- http://msdn.microsoft.com/en-us/windows/apps/
Win32 and COM for Metro style apps
- http://msdn.microsoft.com/en-us/library/windows/apps/br205757(v=VS.85).aspx
APIs for Metro style apps
- http://msdn.microsoft.com/en-us/library/windows/apps/br211369(v=VS.85).aspx
WinRT is a new library that you can use XAML, but not WPF.
WPF is primarily uses DirectX for visual.
You can use WinRT with:
XAML
C#
C++
VB.NET
HTML/JS/CSS
WinRT is a non managed API based on COM interfaces. You use it by calling objects buit in .winmd metadata files ( Windows\System32\WinMedataData directory).
All the namespaces begin with "Windows.".
You can write your Windows 8 application by using XAML files, but that's the only common point with WPF.

What is relation between WPF and Silverlight

These both are same or different ?
How to develop silverlight in visual studio 2008 ?
UPDATE
Please also answer
How to develop silverlight application in visual studio 2008 ?
Both WPF and Silverlight uses what is called XAML to define what the interface / GUI should look like. WPF and Silverlight are both Presentation Layers used on different areas.
WPF is used for Windows based applications whereas Silverlight is used for Web based applications.
Read this blog post about "When should I use WPF vs Silverlight?" over at MSDN.
You can think about Silverlight like a subset of WPF, but there is one main difference. WPF uses full .Net Framework and Silverlight uses different dlls (so you can't use all classes from .Net framework in SL).
Of course Silverlight is a presentation technology that you use to create browser base application (SL can be also an out of browser application) and WPF is used to create windows applications.
Silverlight's original code name was WPF/E with the E standing for "Everywhere". That should help understand the origin of it.
It was designed a a reduced and portable version of WPF, but now both seem to diverge a bit. Here is a good article on how they diverge: WPF Compatibility

Embedding Silverlight control in WPF app - is it possible?

Background:
One of the most attactive feature of Silverlight is PlanProjection because of its ease of use and the stunning effect. Unfortunatelly, it is not available in WPF. I know that similar effects can be achieved using Viewport3D but certainly not with that simplicity.
The App:
I would like to build a Win app designed for dualscreen computer, a bit similar to PowerPoint: 1 fullscreen viewer window for the audience, and 1 regular window to control the app.
The problem:
Building the app in SL is not very appealing: Going to fullscreen always requires user confirmation due to (understandable) security reasons. Detecting primary/secondary screens, their positions is only possible with System.Windows.Forms.Screen class (pls, correct me if I am wrong), which is not available in SL.
The odd solution:
Would it be possible to write my controls in SL utilizing the fancy and simple PlanProjection features and reuse them within a WPF application?
If yes, what impact will I have on the installer? I assume that the installer would need to deploy both .NET framework and SL runtime.
Do you have alternative ideas to facilitate cherry-picking features from the two different worlds?
WPF has rich 3-D capabilities that are far greater than what Silverlight 4 can do so if PlanProjection is the main feature from SL that you require but want to create a desktop application then using WPF all the way would be the way to go. WPF can do everything that PlanProjection can do. Charles Petzold wrote an excellent book on WPF 3-D.
Just use Planerator : http://blogs.msdn.com/b/greg_schechter/archive/2007/10/26/enter-the-planerator-dead-simple-3d-in-wpf-with-a-stupid-name.aspx

WPF VS Silverlight

I had a few questions on WPF & silverlight?
When to use WPF? Some examples on
real time projects where WPF is used
When to use silverlight? some examples of real time projects where silverlight is used
What is the difference between
them?
Can WPF and Silverlight be used together?
How do WPF and silverlight differ from traditional asp.net applications (form based & MVC)???
Does Silverlight use WCF to do it's code behind stuff..like it provides an interface and uses web service to get the code behind?
WPF vs Silverlight will tell you what you want to hear...
WPF is a thick Windows client platform that has access to the full .Net Framework. Silverlight is a browser-based technology that has access to a subset of the .Net Framework
In short I would generally use WPF for form/window applications and use Silverlight for online things. Though these both can be used for either, that is how/when I would use it.
WPF and Silverlight both use XAML, so if you can code in one, you can pick up the other just as easy.
WPF is a client based platform while Silverlight is web based. WPF has the full .NET framework available while Silverlight has a streamlined "smaller" version of the framework.
The nice part is both use the same markup (XAML). Both also can work with the MVVM pattern for easy conversion from client to web app and vice versa.
I would read up a little on the web as these arethe basics of these 2 technologies.
WPF and Silverlight are conceptualy completly different things. They use same technology, but their purpouse is completly different.
WPF is thick client framework, that is supposed to replace WinForms in (I hope) nearest future. It has acces to full .NET framework.
Silverlight is Flash-like technology for rich internet applications and thin clients. It is complementary to standard ASP.NET technology. If you want to increase amount of eye-candy or give user much richer interaction options for your web, this is way to go.
They both use same visual-description technology (XAML) and same principles (DataBinding, Templating, Separation of visuals and code, etc..). But their intended usage is different.

WPF vs Silverlight [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
What is the difference between WPF and Silverlight application?
What are the exact differences between WPF and Silverlight?
That's an extremely broad question. My company recently wrote a whitepaper outlining the differences between the two technologies, and it's around 70 pages. Unfortunately, it's not published yet, or I'd give you the link.
EDIT: As promised, here's the link
to the whitepaper on Codeplex:
http://wpfslguidance.codeplex.com/
However, I'll try to summarize.
WPF is a thick Windows client platform that has access to the full .Net Framework. Silverlight is a browser-based technology that has access to a subset of the .Net Framework (called the CoreCLR). So, you'll notice differences using seemingly every day methods and objects within the framework. For instance, the Split() method on the String class has 3 overrides in Silverlight, but 6 in the .Net Framework. You'll see differences like this a lot.
Within WPF, all visually rendering elements derive from the Visual base class. Within Silverlight, they do not; instead, they derive from Control. Both technologies, however, eventual derive from the DependencyObject class up the hierarchy.
WPF, currently, ships or has available more user controls than Silverlight; though this difference is being mitigated through the Silverlight Toolkit and the upcoming release of Silverlight 3.
WPF supports 3 types of routed events (direct, bubbling, and tunneling). Silverlight supports direct and bubbling only.
There's quite a few data-binding differences that will be somewhat mitigated with the next version of Silverlight. Currently, Silverlight doesn't support the binding mode, OneWayToSource, or Explict UpdateSourceTriggers. In addition, Silverlight defaults to OneWay databinding if none is set, while WPF uses the default mode specified by the dependency property.
Silveright doesn't support MultiBinding.
Silverlight supports the XmlDataProvider but not the ObjectDataProvider. WPF supports both.
Silverlight can only make asynchronous network calls. WPF has access to the full .Net networking stack and can make any type of call. Also, currently, Silverlight supports SOAP, but can not handle SOAP fault exceptions natively (this may change in Silverlight 3).
There are huge differences in Cryptography (Silverlight has 20 classes in the namespace, while WPF has access to 107). Basically, Silverlight supports only 4 hashing algorithms and the AES encryption protocol.
Silverlight doesn't yet support: Commanding, Validation, Printing, XPS Documents, Speech, 3D, Freezable objects, or InterOp with the Windows Desktop; all of which are available in WPF.
Silverlight supports browser interop, more media streaming options including timeline markers, and Deep Zoom. WPF doesn't support these features yet.
This is by no means complete as I was trying to reduce a 70-page document into bullet points.
Finally, even with all these differences, Microsoft is trying to close the gap between the two technologies. The Silverlight Toolkit and the WPF Toolkit both address some of the shortcomings of each technology. Silverlight 3 will be adding many features not currently available (such as element-to-element data binding). However, due to the differences in the core libraries, there will always be some Framework differences.
WPF is a Windows desktop technology for developing Windows application in the .Net framework.
Silverlight is a web technology, that is fully supported by a browser plugin on both Windows and MAC (in a similar fashion to Flash). There is also a plugin for running Silverlight on Linux (Moonlight).
While there are similarities between the functionality provided by both WPF and Silverlight (in terms of user interface components and support for XAML) Silverlight is a much small framework, containing a subset of WPF functionality. Newer versions of Silverlight actually contain some functionality not found in WPF, so it is no longer a true subset.
Things that WPF has that Silverlight doesn't: Full 3d engine based on DirectX, Windows integration such as Windows 7 taskbar thumbnails and system registry availability as well as access to the full .NET Framework including Oracle database support. Also, SL runs in a secure sandbox that prevents access to things such as the entire file system where WPF apps can run full trust with complete system access.
As mentioned above, SL pioneered some technologies such as the VisualStateManager which are making their was secondarily into WPF through the Microsoft supported WPF toolkit.
If you're looking to gauge which technology is right for your project here's a simple way to look at it: If you're writing an app that's meant to run while disconnected from the web, or if you're writing an app that needs access to Windows specific features like the ones listed above then WPF is the way to go. For platform-agnostic, web enabled apps Silverlight is an appropriate choice. Hth.
You could say that it is [VERY] roughly analogous to the difference between Flex and Adobe Air, but that is somewhat misleading.
WPF refers to the set of technologies (exposed via APIs) that .NET Framework 3.0 and above users have access to in order to draw to the screen.
Many of the WPF APIs are available for Silverlight apps.
There are, of course many other APIs besides WPF that are available under Silverlight since SL apps will need to do a lot more than just draw on the screen.

Resources