1

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?

2 Answers2

1

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).

Lars
  • 191
  • 4
1

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

Hans Karlsen
  • 2,275
  • 1
  • 15
  • 15