Connection and difference between WPF, Windows Forms, and Silverlight
I received an email from a student:
======================================
Hello, instructor Jin:
Recently, I learned almost the basic syntax in C #. net. Next I want to learn the graphic interface design section. However, currently. net's winform, WPF, and Silverlight relationship is not very clear. Generally, the book rarely introduces WPF and Silverlight. I searched the internet for the differences between winform and WPF, some say that winform is a subset of WPF, and some say that winform and WPF are co-existent and messy. What is the relationship between the three of you?
Your students ========================================= The following is my understanding of the relationship between the three, if this is not the case, ask your friends in the industry to correct it. In Windows, functions such as form drawing are implemented by GDI and placed in the operating system kernel. Windows
Forms uses GDI + at the underlying layer. GDI + is the "Object-Oriented packaging" of GDI, which is implemented in C ++ .. Net windows
The GDI + used in forms applications is actually another layer of the unmanaged code implemented in C ++, so that we can use a hosting programming language such as C # To call the GDI + function drawing. The underlying layer of WPF is DirectX, which is usually used for game development. WPF and windows
Forms has no relationship with each other. According to Microsoft's intention, WPF is used to replace windows form, so the latest visual
Studio uses the WPF development interface, which is a clear signal. Of course, for compatibility purposes, Windows Forms and WPF will coexist for a long time and can be viewed as two sets of independent interface technologies. Silverlight can be seen as a subset of WPF at the API layer, but in fact, Silverlight and WPF have no connection except this. Because Silverlight applications do not depend on. NET
Framework, as long as the user's computer (or mobile phone) has installed the Silverlight runtime environment (for example, the user adds the Silverlight plug-in to the browser through the Internet), you can run the Silverlight application, users are not required to install large. net
Framework. The Silverlight runtime environment can also be viewed as a subset of standard. NET Framework functions at the API level, but it is completely rewritten and independent of standard. net.
To facilitate application development, Microsoft strives to maintain API-level consistency between the two. However, it does not rule out that the Silverlight runtime environment will be completely new in the future. is not available in the standard environment. Windows
Forms, WPF, and Silverlight are actually three independent technical fields, but for the convenience of development, Microsoft, it is intended to make Silverlight and WPF highly consistent in the application-level development experience (or even most of the application-layer code. From the perspective of development, Windows Forms has a long history and is highly mature. It has a large number of third-party controls and other resources. If you develop Windows applications of the "standard" and "general" interface types, using it can achieve high development efficiency and good running performance. The strength of WPF is that it can develop very "personalized" Windows applications, and you can implement various user interfaces that you can "dream" without any restrictions, besides, in animation and other multimedia aspects, WPF is better than Windows Forms. Besides, WPF's data binding mechanism is more powerful and flexible than Windows Forms. The shortcoming of WPF is that it has high requirements on computer hardware. For computers with low hardware configurations, its running performance is inferior to that of Windows Forms. For now, Windows 7 is the best platform for WPF. Windows Forms and WPF are mainly used to develop desktop applications. Silverlight is mainly used to develop Internet applications for Ria, or applications running on smart mobile devices such as mobile phones. In this case, WPF can be used to develop a Silverlight application without too much effort. The two are too similar, especially for interface-Layer Code because both use XAML, this makes it easier for us to develop "desktop edition", "mobile edition", and "browser edition" for an application at the same time, the user interfaces of these three versions have the same appearance and user experience.