Patterns used in WPF

I have been participating in WPF for over a year. Many things are new, and sometimes it’s hard for me to turn my head around.

At the same time, I am re-reading the GOF design pattern book.

Several times I stopped in the middle because I realized that a certain template is used in some WPF functions. Whenever such awareness strikes me, I feel that my understanding of the WPF principle associated with it has just taken a big leap. It looks like an aha effect.

I also realized that, for example, I understood Prism much easier, because the documentation does such a wonderful job of explaining related patterns.

So here is my “question” (more like an effort):

To help us all understand WPF, it would be great if someone who also “noticed” the design pattern in WPF could give a short explanation.

One pretty obvious example I found is the Routed Event:

If an event is detected by a child control and no handler is specified, it passes its parent and so on until it is finally processed or no parents are found.

Suppose we have an image on a button that is inside a StackPanel, which is inside a window. If the user clicks the image, the event will either be processed by him (if the processing code were specified) or a “bubble” until one of the controls processes it. So each control will get the opportunity to respond in that order.

  • Picture
  • Button
  • Stackpanel
  • Window

, .

WPF .

" Design Pattern", , , , . , , . .

, , ( , 10 + ) .

, , .

,

+3
2

, WPF, , -, , .NET WPF.

" " " , ". .Net + = . - =.

0

, CommandBindings .

-1

Source: https://habr.com/ru/post/1723458/


All Articles