private void FillViewModelWithBundle(Bundle bundle, IQuestViewModel viewModel) { DateTime?startTime = null; DateTime?deadline = null; viewModel.IsImportant = bundle.GetBoolean(IsImportantKey); viewModel.UseStartTime = bundle.GetBoolean(UseStartTimeKey); viewModel.UseDeadline = bundle.GetBoolean(UseDeadlineKey); _dateTimeStateHandler.Extract(StartTimeKey, bundle, ref startTime); _dateTimeStateHandler.Extract(DeadlineKey, bundle, ref deadline); viewModel.StartTime = startTime; viewModel.Deadline = deadline; }
///<inehrtidoc/> public override Dialog OnCreateDialog(Bundle savedInstanceState) { RecyclerView recycler = LayoutInflater.From(Activity).Inflate(Resource.Layout.ValidationErrorsFragmentLayout, null) as RecyclerView; Context currentContext = this.Context; if (recycler != null) { IList <ClarifiedError <int> > errors = new List <ClarifiedError <int> >(); if (Arguments != null) { _clarifiedErrorsStateHandler.Extract(ClarifiedErrorsKey, Arguments, ref errors); } recycler.SetLayoutManager(new LinearLayoutManager(currentContext)); recycler.SetAdapter(new ValidationDialogFragmentAdapter(currentContext, errors)); } return(new AlertDialog.Builder(currentContext). SetTitle(Resource.String.ValidationDialogTitle). SetPositiveButton(Android.Resource.String.Ok, ValidationOkHandler). SetView(recycler). Show()); }
/// <summary> /// Tries to retrieve date time, that was placed there by instance this class. /// </summary> /// <param name="bundle"></param> /// <returns></returns> public static DateTime?GetItsDateTime(Bundle bundle) { DateTime?dateTime = null; DateTimeHandler.Extract(DateTimeValueId, bundle, ref dateTime); return(dateTime); }
/// <summary> /// Parses saved instance state. /// </summary> /// <param name="bundle"></param> private void ExtractViewModelState(Bundle bundle) { var details = ViewModel.QuestViewModel; _questDetailsStateHandler.Extract(ViewModelKey, bundle, ref details); }