Henrik Leijonhufvud
Henrik Leijonhufvud

Reputation: 230

Initiation of vmVariables that are not persistent?

If I declare a variable of a class that is not persistent in a VM; Do I need to initiate it and how? Pure declaration does not seem to do the trick. A create statement in the onShow statement in the navigation action to the page does not seem to do the trick either? Bug or am I misunderstanding something?

Upvotes: 1

Views: 38

Answers (2)

Hans Karlsen
Hans Karlsen

Reputation: 2435

Guessing you have a variable that is typed as a class - and you need to init the variable by instansiating an object? Do this in onshow like in the image below:

Mdriven init of variable that has a class type

Upvotes: 1

Lars
Lars

Reputation: 201

Sorry, but there's several confusing things in your question.

Are we talking about a transient class with attributes?

Variables in a viewmodel? Variables in a viewmodel are always transient (non-persistent).

Upvotes: 1

Related Questions