You have some domain data in Gui controls, and domain functions need to access the data.Copy the data to a domain object. Create an observer mode to synchronize repeated data in the domain object and GUI object.
Motivation: a well-layered system should process user interfaces and business logicCodeSeparated. The reasons for doing so are as follows: 1) You may need to use different user interfaces to express the same business logic. If you assume two responsibilities at the same time, the user interface will become too complex; 2) After being isolated from the GUI, maintenance and evolution of domain objects will be easier. You can even let different developers take charge of development of different parts.
Although "behavior" can be easily divided into different parts, "data" is often not the case. The same item of data may be embedded in both GUI controls and Domain Models. Since the emergence of the MVC mode, the user interface framework uses a multi-layer system to provide a certain mechanism, so that you can not only provide such data, but also keep them synchronized.
If the code you encounter is developed in a 2-layer manner and the business logic is embedded in the user interface, you need to separate the behavior. The main task is to break down and move functions. But the data is different. You cannot just move the data. You must copy it to a new object and provide a synchronization mechanism.