コード例 #1
0
 public MvxChildViewModelOwnerAdapter(IMvxEventSourceActivity eventSource)
     : base(eventSource)
 {
     if (!(eventSource is IMvxChildViewModelOwner))
     {
         throw new MvxException("You cannot use a MvxChildViewModelOwnerAdapter on {0}",
                                eventSource.GetType().Name);
     }
 }
コード例 #2
0
        /// <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;
            }
        }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
        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;
        }
コード例 #5
0
        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;
        }
コード例 #6
0
 public MvxBindingActivityAdapter(IMvxEventSourceActivity eventSource)
     : base(eventSource)
 {
 }
コード例 #7
0
 public MvxActivityAdapter(IMvxEventSourceActivity eventSource)
     : base(eventSource)
 {
 }