En tal situación, puedes aliviar la carga de reiniciar parte de tu actividad utilizando un objeto ViewModel.
In such a situation, you can alleviate the burden of reinitializing part of your activity by using a ViewModel object.
Con estos elementos, puedes implementar tu objeto ViewModel, como en el siguiente ejemplo
With these pieces in place, you might choose to implement your ViewModel object, as in the following example
En la pantalla Configure Activity, escribe nombres para la actividad inicial, el fragmento y el objeto ViewModel con el que iniciarás tu proyecto.
On the Configure Activity screen, enter names for the initial activity, fragment, and ViewModel object with which to start your project.
Alte rezultate
Dado que se espera que los objetos ViewModel duren más que los objetos View correspondientes que actualizan, no debes incluir referencias directas a objetos View dentro de tu implementación de ViewModel.
Given that ViewModel objects are intended to outlast the corresponding View objects that they update, you shouldn't include direct references to View objects within your implementation of ViewModel.
Esta propiedad se refiere a los padres ViewModel objeto.
This property refers to parent ViewModel object.
Un objeto de ViewModel proporciona los datos para un componente de IU específico, como un fragmento o una actividad, e incluye lógica empresarial de manejo de datos para comunicarse con el modelo.
A ViewModel object provides the data for a specific UI component, such as a fragment or activity, and contains data-handling business logic to communicate with the model.
El modo en el que Bind trata los tipos de datos y los Paths es un poco diferente, en algunos casos no solo es cambiar Binding por Bind, sino especificar también el path correcto al objeto en el ViewModel
The way in which Bind handles data types and Paths is slightly different, in some cases, not only is change Binding by Bind, but also specify the correct path to the object in the ViewModel
ViewModel es un objeto Javascript que contiene propiedades y funciones para representar los datos necesarios.
ViewModel is a Javascript object which contains necessary properties and functions to represent data.
No deberían intentar adquirir sus propios eso, usa un ViewModel y observa un objeto LiveData para que los cambios se reflejen en las vistas.
They should not try to acquire their own data; instead, use a ViewModel to do that, and observe a LiveData object to reflect the changes back to the views.
Además, el alcance de un ViewModel está vinculado al ciclo de vida de una Activity o un Fragment, lo que implica que los datos del Webservice se pierden cuando finaliza el ciclo de vida del objeto de IU asociado.
Additionally, the scope of a ViewModel is tied to an Activity or Fragment lifecycle, which means that the data from the Webservice is lost when the associated UI object's lifecycle ends.
Conținut posibil inadecvat
Exemplele au rolul de a te ajuta să traduci cuvinte sau expresii corect si adaptat la context. Nu sunt selectate sau validate manual, așadar pot conține termeni inadecvați. Te rugăm să raportezi exemplele pe care le consideri inadecvate. Traducerile vulgare sau colocviale sunt în general marcate cu roșu sau cu portocaliu.
Nici un rezultat pentru acest sens.
Sinonime și analogii pentru "objeto ViewModel" în limba Română