[Reprinted] WPF getting started tutorial Series 1-basic and wpf getting started tutorial

Source: Internet
Author: User

[Reprinted] WPF getting started tutorial Series 1-basic and wpf getting started tutorial

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 program sets, namely PresentationCore, PresentationFramework, and WindowsBase, as 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.

Reposted from: WPF getting started tutorial Series 1-Basics

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.