What is the WPF GUI responsible for?

I have been using WPF and Xaml for a while, and I like it quite a bit. However, I'm probably still developing things like the days of WinForm with too much code and responsibility in the GUI section.

Anways, in the WPF model, what exactly is the GUI for? If a button is pressed in the graphical interface, should it show a popup and handle any updated values? If there is validation logic, should the missing / invalid fields be checked and updated? Should it handle any event handler logic such as clicks, value changed, etc.?

This list is likely to go on and on. However, I think the main question is, should the GUI only display data from the class and process new data in the class? Everything else, which is almost everything, needs to be decided elsewhere.

+3
source share
3 answers

wpf gui can technically do anything depending on the approach. You should see some of the first wpf applications I worked with, and I'm still working. If you want to follow the best practices and make the most of your work with wpf, you should use the MVVM template.

, , . , , , viewmodel. , , /, .

, , xaml , .

, IMHO, , , / , , viewmodel, . View/Viewmodel/Model , , .

, . MVVM :

http://www.codeproject.com/KB/WPF/MVVMQuickTutorial.aspx?msg=3655304#xx3655304xx

+3

. WPF .

. . , MCV/MVP, GUI. , WPF, MVVM. MVVM, , google , .

+2

GUI ( ) ( , ).

, XAML . , , , , . .

, , , .

:

  • , , (.. ), , popup, .

  • , , , .

  • , ToggleButton .

  • , , (, "SetProperty" , , ).

  • , .

  • (, ), multicommand, XAML.

  • , , . .

  • , , . , UI (, ).

  • Click, . , , , . XAML (, SetProperty Paste). , .

  • . WPF . , WPF , , .

0

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


All Articles