Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to transfer (communicate, pass) data between UIWindowBase #16

Closed
takaaptech opened this issue Jan 19, 2018 · 4 comments
Closed

How to transfer (communicate, pass) data between UIWindowBase #16

takaaptech opened this issue Jan 19, 2018 · 4 comments

Comments

@takaaptech
Copy link
Contributor

Hi again!
I want to understand what is common and best way to pass data between UIWindowBase (window)
For example:

  • From window1 we pass some data each time window2 open (by press button on window 1) will get data and draw some UI base on that data.
  • And then when we in window2, we modify some data and close window2, put some data back to window1, window1 will collect data and then update some UI.

Thank so much!

@kisence-mian
Copy link
Owner

kisence-mian commented Jan 19, 2018

The usual practice is that the UI does not save the data, the data stored in the model layer (MVC), when the data is updated, distribute this event, the other UI listened to this event, reread the data to update itself,

Events can use GlobalEvent, this is another wiki :)

@takaaptech
Copy link
Contributor Author

OK thank for clearing that!
How about model layer class, is it a normal class or extend from some class in the framework?

@kisence-mian
Copy link
Owner

Is a normal class that dispatches the corresponding event when it is modified.

@takaaptech
Copy link
Contributor Author

So i will wait for GlobalEvent wiki page! Thank @GaoKaiHaHa !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants