void Awake() { //Check if there is already an instance of MainPageHandler if (instance == null) { //if not, set it to this. instance = this; } //If instance already exists: else if (instance != this) { //Destroy this, this enforces our singleton pattern so there can only be one instance of MainPageHandler. Destroy(gameObject); } }
public MainPageViewModel() { _eventElements = new ObservableCollectionPropertyNotify <WorktimeEventDetails>(); _handler = new MainPageHandler(this); }