public void SetViewModel(int id) { viewModel = factory.Get(id); RemoveSubscriptions(); Init(); viewModel.NotifyModelChanged(); }
private void Start() { factory = GetComponentInParent <FactoryBase <T> >(); viewModel = factory.Get(Preferences == ViewModelPreferences.Current ? 0 : ViewModelID); if (Preferences == ViewModelPreferences.Current) { ViewModelSubscriptionHandler.Instance.Subscribe(typeof(T), OnViewModelChanged); } Init(); }