WPF getting started tutorial system 1-basics and wpf getting started tutorial Basics
I. Preface
Recently, I was studying WPF. The first thing I learned was Microsoft's MSDN. Then I searched for some network-related learning materials about WPF. For the sake of warmth, Zhixin records the learning process for future reference. This article describes how to use Visual Studio 2013 to create a WPF application.
First, let's talk about the basic knowledge of WPF:
1) A. NET-supported programming language should be used. For example, C #.
2) A Bit Of "Standard Generic Markup Language": The XAML language used by the WPF form program, also belongs to a branch of "Standard Generic markup language. If you have been familiar with "Standard Generic Markup Language" such as XML, HTML, XHTML, and ASP. NET before, it is helpful for learning.
3) have some experience in WinForm or ASP. NET, mainly understanding the handling of control events.
4) Good Object-oriented Thinking: in WPF, we often need to use various inheritance relationships, polymorphism, and overloading flexibly.
5) DataBinding: Binding is a highlight of WPF.
6) have a certain understanding of the design model: Of course, the deeper the better, in the actual project, various design patterns are often used in combination.
Ii. Tools used in this series:
1) Development Environment: Windows 7 Chinese Version
2) development tools: Visual Studio 2013 Chinese Version
3) Database: Local SQL Server 2012 Express
4) ORM tool: Entity Framework (Entity Framework ).
Comparison between Entity Framework and nhib.pdf:
1) The Entity Framework is more encapsulated and easier to add, delete, modify, and query.
2) Entity Framework uses more convenient Linq to Entity queries and delays loading (loading only when needed, loading only the required data ).
Iii. WPF development Basics
First, after installing the aforementioned tools, open Visual Studio 2013 and select "menu-> file-> New-> Project ". For example.
2. In the "new project" dialog box, select "WPF Application", change the name to WpfApp1, and click "OK" to create a "WPF application ". The public class libraries referenced by the newly created Project are as follows. For example. (The "WPF Application" will automatically add the three core assembly PresentationCore, PresentationFramework, and WindowsBase shown in "Reference ).
Third, the file structure generated by the WpfApp1 project. For example.
4. The "StartupUri" attribute in App. xaml can specify the startup form when the project is running. For example, "StartupUri =" MainWindow. xaml "can also define the system resources we need and introduce the assembly. For example.
Fifth, we can modify the Title in the design form of MainWindow. xaml. You can also set MainWindow attributes and add events. After completing these settings, we can add content to the form, as shown in. I added a ListView, two WrapPanel, and two buttons to this form.
Sixth, you can add the following resources to the xmal file of WPF. For example.
Iv. Summary
Besides Visual Studio, you can also use Expression Blend to create a WPF application.
When talking about the development of WPF, you must first understand the concepts of MVC and MVP to learn MVVM.
I have made WinForm and ASP myself. NET. NET technology projects, although Microsoft's technology has been improving and changing, but the most basic things have not changed, such as database access, file read/write, log processing, program exception handling, reporting, printing, performance optimization, user-friendly interface.