public MvxChildViewModelOwnerAdapter(IMvxEventSourceActivity eventSource) : base(eventSource) { if (!(eventSource is IMvxChildViewModelOwner)) { throw new MvxException("You cannot use a MvxChildViewModelOwnerAdapter on {0}", eventSource.GetType().Name); } }
/// <summary> /// Remove any attached events to free memory /// </summary> protected void DetachEvents() { IMvxEventSourceActivity droidEvents = TopActivity as IMvxEventSourceActivity; if (droidEvents != null) { droidEvents.NewIntentCalled -= droidEvents_NewIntentCalled; droidEvents.PauseCalled -= droidEvents_PauseCalled; droidEvents.ResumeCalled -= droidEvents_ResumeCalled; } }
public static void AddEventListeners(this IMvxEventSourceActivity activity) { if (activity is IMvxAndroidView) { var adapter = new MvxActivityAdapter(activity); } if (activity is IMvxBindingContextOwner) { var bindingAdapter = new MvxBindingActivityAdapter(activity); } if (activity is IMvxChildViewModelOwner) { var childOwnerAdapter = new MvxChildViewModelOwnerAdapter(activity); } }
public MvxBaseActivityAdapter(IMvxEventSourceActivity eventSource) { _eventSource = eventSource; _eventSource.CreateCalled += EventSourceOnCreateCalled; _eventSource.CreateWillBeCalled += EventSourceOnCreateWillBeCalled; _eventSource.StartCalled += EventSourceOnStartCalled; _eventSource.RestartCalled += EventSourceOnRestartCalled; _eventSource.ResumeCalled += EventSourceOnResumeCalled; _eventSource.PauseCalled += EventSourceOnPauseCalled; _eventSource.StopCalled += EventSourceOnStopCalled; _eventSource.DestroyCalled += EventSourceOnDestroyCalled; _eventSource.DisposeCalled += EventSourceOnDisposeCalled; _eventSource.SaveInstanceStateCalled += EventSourceOnSaveInstanceStateCalled; _eventSource.NewIntentCalled += EventSourceOnNewIntentCalled; _eventSource.ActivityResultCalled += EventSourceOnActivityResultCalled; _eventSource.StartActivityForResultCalled += EventSourceOnStartActivityForResultCalled; }
protected MvxBaseActivityAdapter(IMvxEventSourceActivity eventSource) { _eventSource = eventSource; _eventSource.CreateCalled += EventSourceOnCreateCalled; _eventSource.CreateWillBeCalled += EventSourceOnCreateWillBeCalled; _eventSource.StartCalled += EventSourceOnStartCalled; _eventSource.RestartCalled += EventSourceOnRestartCalled; _eventSource.ResumeCalled += EventSourceOnResumeCalled; _eventSource.PauseCalled += EventSourceOnPauseCalled; _eventSource.StopCalled += EventSourceOnStopCalled; _eventSource.DestroyCalled += EventSourceOnDestroyCalled; _eventSource.DisposeCalled += EventSourceOnDisposeCalled; _eventSource.SaveInstanceStateCalled += EventSourceOnSaveInstanceStateCalled; _eventSource.NewIntentCalled += EventSourceOnNewIntentCalled; _eventSource.ActivityResultCalled += EventSourceOnActivityResultCalled; _eventSource.StartActivityForResultCalled += EventSourceOnStartActivityForResultCalled; }
public MvxBindingActivityAdapter(IMvxEventSourceActivity eventSource) : base(eventSource) { }
public MvxActivityAdapter(IMvxEventSourceActivity eventSource) : base(eventSource) { }