protected override void OnCreate(Bundle savedInstanceState)
        {
            AssociatedActivityId = savedInstanceState?.GetString(ActivityControllerRegistry.ASSOC_ACTIVITY_ID)
                                   ?? Intent?.GetStringExtra(ActivityControllerRegistry.ASSOC_ACTIVITY_ID)
                                   ?? Guid.NewGuid().ToString();

            ActivityControllerRegistry.Associate <TController> (AssociatedActivityId, this);

            base.OnCreate(savedInstanceState);

            OnCreateHandler?.Invoke(savedInstanceState);
        }
Beispiel #2
0
 public Task <TActivityResult> StartActivityForResultAsync <TActivityResult>(Intent intent) where TActivityResult : ActivityResult
 {
     return(StartActivityForResultAsync <TActivityResult>(intent, ActivityControllerRegistry.NextRequestCode()));
 }
Beispiel #3
0
 public Task <ActivityResult> StartActivityForResultAsync(Intent intent)
 {
     return(StartActivityForResultAsync(intent, ActivityControllerRegistry.NextRequestCode()));
 }
Beispiel #4
0
        public TController GetActivity <TActivity, TController>() where TActivity : ActivityController where TController : ControllerActivity <TActivity>
        {
            var info = ActivityControllerRegistry.Get <TActivity>(AssociatedActivityId);

            return((TController)info.ControllerActivity);
        }
Beispiel #5
0
 protected virtual void Finish()
 {
     Activity.Finish();
     ActivityControllerRegistry.Destroy(AssociatedActivityId);
 }
        public Task <ActivityResult> StartActivityForResultAsync(Intent intent, int requestCode)
        {
            var info = (AssociatedActivityInfo <TController>)ActivityControllerRegistry.Get(AssociatedActivityId);

            return(info.ControllerActivity.StartActivityForResultAsync(intent, requestCode));
        }
        public TController GetController()
        {
            var info = (AssociatedActivityInfo <TController>)ActivityControllerRegistry.Get(AssociatedActivityId);

            return(info.ActivityController);
        }