Deep analysis of dependency properties (Wpf/silverlight Core) (top)

Source: Internet
Author: User

I. Summary

We talked about some of the basics of WPF, but there is no contact with the core concept, then from the beginning of this article in the following several articles, we will discuss the dependency properties, routing events, commands and bindings and other related concepts, hope that these articles for everyone to help. Because of their talents and is the use of these technologies summary and experience, the error is inevitable, with the mentality of technical exchange, published here, so I hope you can give a lot of guidance, so that some people benefit while also correcting my erroneous views, in order to improve with you together.

Two. Outline of this article

· 1. The SUMMARY

· 2. Outline of this article

· 3. Something more important than this article

· 4. Cloud computing Advertising spots

· 5. Basic Introduction to dependency properties

· 6. Priority of dependent properties

· 7. Inheritance of dependent properties

· 8. Read-Only dependency properties

· 9. Additional Properties

· 10. Clear local values

· 11. dependency property Meta Data

· 12. Dependency property callback, validation, and coercion values

· 13. Dependency property Monitoring

· 14. Code snippets (automatically generated)

· 15. Simulate dependency property implementation

· 16. This paper concludes

· 17. Related Code Download

· 18. Series Progress

Three. Something more important than this article

Before we talk about this article, let's talk about something more important, that is, "giving people and fish is better than giving people a fishing", what is this "fishing"? We have been doing software for many years, for one or more of their own skills have their own experience and experiences, but in general can be divided into inward and outward as well as the expansion of three aspects (here only for. NET platform):

(i) Outward:

Using technologies such as ASP.net, WinForm, asp.net MVC, WPF, Silverlight, WF, WCF, and so on, and with a wealth of experience while doing projects with these technologies, you can form your own set of development knowledge bases, Know how these technologies can quickly build the applications that businesses need, what problems they will have in use, and how to solve them. Then at this point you may have played a more central role in the team, if the project manager gives you a task, you can also be very easy and efficient, while in the project because you are also more clear business logic, so when the opportunity comes, you will soon become the backbone of the team, Gradually you will take a few junior engineers together to do the project, if you do not like to bring a team, you will become a senior senior development or architect. Then in the outward aspect I personally think the most important is accumulates the experience, to the common application to be more familiar and has own summary a set of development storehouse-for instance to the ordinary website, the electronic commerce system, the ERP, the OA, the client application and so on has the quite rich experience.

(ii) Inward:

Before you use these technology development projects, you will encounter a lot of problems, in order to solve these problems, you will gradually study some of the bottom level of things. For example, for ASP.net, you will gradually understand the whole process of asp.net, the life cycle of the page, the development of custom control, etc., because of their original C, C + +, Java, such as the transition to. NET, so for some details like a dead end, which also wasted a lot of time, But at the same time also got a lot of unexpected joy.

For the C # language, you will also gradually find out what secrets are hidden behind these grammatical sugars, many of them. NET technology more obsessed people will choose to C # 1.0 language through the IL code to deep understanding, and then to c#2.0, c#3.0, c#4.0 are compiled for C # 1.0来 learning, so they can realize the language inside exactly how to execute, is the so-called know also know its why.

For WF, you should not only know the use of each activity, you also have to know its internal principles, such as WF internal is dependent on the property to rely on the activities in the workflow to pass the attribute value, if you carefully, you restore WF dependent attribute source code, you will find it and WPF, The dependency properties in Silverlight are similar in principle, and are only appropriately tuned for specific technologies.

The same is the case for the low-level operation of the data, whether you are using a concatenation of SQL, stored procedures, ibatis.net, Nhibernate,active, LINQ to SQL, Entity framework, or an ORM component that you developed. You have to understand how it works, and you need to know that the Open-source code is worth studying, my experience is to use these features first, then dissect the source code, then write my own framework, and now I'm streamlining my ORM framework, because I've focused on achieving as many functions as possible, So the details of performance and so do not do too much optimization, the back will also learn slowly to everyone.

As with WPF and Silverlight, you not only need to know how to use these techniques, you need to know how it works, such as the dependency properties, you know how it works, and you can do something about how the values that I set up don't work, how my binding elements don't appear, and so on. For routed events, you will often encounter how my events are not executed, how my custom control events are handled incorrectly, how routing passes do not work, and so on, when you have a deep understanding of the internal processing of routed events, these problems are solved; for WPF and Silverlight new Extra command features, many times we are also more puzzled, will encounter command failure and so on, in fact, if you understand the principle of its in-depth, you will know, it is in fact inside is also an event, but Microsoft did a lot of encapsulation in it; it's even more so for binding. , we don't want to talk about it in this article, after all, in the following several articles will be detailed on these technologies involved.

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.