WinRT and WPF in Windows 8 - wpf

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.

Related

create windows 10 app with wpf

I have a simple question : Is it possible to create a windows 10 app (tablet for my case) in WPF instead of UWP ? Because actually my app need a framework that allow to create pdf, but none free framework exist in UWP yet, but un WPF this is quite different. Thank you.
WPF apps are fully supported on Windows 10, so nothing stops you from using WPF instead of UWP!
In fact, you can even take advantage of UWP features in WPF apps by using the Desktop Bridge (Centennial)

XAML vs WPF vs Store App vs Phone App vs UWA

I know that XAML is used for designing UI in combination with Blend. I am confused with so many terms, like, how XAML comes into play for WPF, Store App, Phone App or UWA. Morever, what is the difference between WPF, Store App, Phone App and UWA. Does all that means that old Desktop Project will no longer be used and replace by either WPF or Store App or UWA?
When .NET was released in ~2000, you could use WinForms to make desktop applications for Windows. It provides access to 'native' controls (i.e. A Button made in WinForms actually is a Windows Button control from user32.dll) by wrapping the Windows API in managed code. These can run in any version of Windows which has the appropriate .NET framework version installed, including upto Windows 10.
In 2006, WPF was released which is an alternative to WinForms. WPF uses XAML, which is a language based on XML, to declare the user interface elements. In a simple WPF app, the .xaml file describes the GUI and the code-behind file describes the logic. DirectX is used to draw whatever is described in the .xaml into the window.
Like Winforms, programs made using WPF can run in any version of Windows which has the appropriate .NET framework version installed, including upto Windows 10. Note that using XAML is completely optional. Whatever user interface elements you describe using XAML can also be made using your .NET language C# or VisualBasic.NET. But using XAML is usually simpler. See To XAML or not to XAML (MSDN Blogs).
From XAML (Wikipedia) :
As XAML is simply based on XML, developers and designers are able to share and edit content freely amongst themselves without requiring compilation.
From ~2012 along with Windows 8, a new kind of app called metro/modern/windows-8/windows-store-apps can be made. These apps are similar to WPF in that they use XAML for describing the GUI. These apps can run only in Windows 8, 8.1 and Windows 10. Windows 8.1 added some improvements and features but remained mostly the same. The same technology was used to make apps for Windows Phone.
With the release of Windows 10, Microsoft made UWP (Universal Windows Platform) through which you can use the same code base to target differnt kinds of devices (desktop/mobile/xbox/IoT/holographic). These apps made for the UWP are similar to the earlier Windows 8/8.1 apps. Like before, XAML is used to describe the GUI.
Only for the Windows Store apps, there is no backward compatibility. The timeline goes Windows 8 -> Windows 8.1 -> Windows 10/UWP. An app made in UWP can only run in Windows 10 and an app made in Windows 8.1 can not run in Windows 8.
I would highly recommend referring to this discussion thread in stopbyte, it has far more details and explanation of the concepts behind WPF, UWP And WinRT.
As for WinForms, from my experience it's history now. Have been almost replaced by WPF (though it still has mainstream support as mention by #Jazimov).
I'v noticed that Microsoft has stopped improving Windows Forms and probably has stopped maintaining it as well.

WPF - Windows Forms Interoperation

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

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

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