c# - Pass WPF textbox.text from Window1 to data class -


i have wpf window collects data , sends data class saved xml file. want name file in textbox on window1 form , pass data class file can saved. know have let data class know window1 exists, i'm having trouble syntax - guess.

you should try other way around: view (wpf) should know view model (wrapper) knows how collect data, should used save file. vm should know model (the implementation of file save stuff among other models data sources etc.) , feed necessary information.

using approach combined nootification, can swap out several parts without affecting others.

  • the model (back end) independant of else.
  • the view can defined elsewhere , shouldn't use code behind (except definition of vm , events). binds vm.
  • the view model puts together. provides data structure, can used , presented in wpf. through binding vm informs wpf of updates etc.

in case:

  • design nice gui
  • design vm can collect necessary information.
  • write method takes parameters required file.
  • in event or command handler (click etc.) call vm method passes collected info file method.

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -