Example #1
0
        public async override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            bool useDraft = false;

            if (savedInstanceState != null)
            {
                useDraft = savedInstanceState.GetBoolean(UseDraftKey, useDraft);
            }

            if (viewModel == null)
            {
                var timeEntryList = await EditTimeEntryActivity.GetIntentTimeEntryData(Activity.Intent);

                TimeEntryData timeEntry = null;
                if (timeEntryList.Count > 0)
                {
                    timeEntry = timeEntryList[0];
                }

                viewModel = new EditTimeEntryView(timeEntry);
            }

            viewModel.OnIsLoadingChanged += OnModelLoaded;
            viewModel.Init(useDraft);
        }
        public async override void OnViewCreated(View view, Bundle savedInstanceState)
        {
            base.OnViewCreated(view, savedInstanceState);

            if (viewModel == null)
            {
                var timeEntryList = await EditTimeEntryActivity.GetIntentTimeEntryData(Activity.Intent);

                viewModel = new EditTimeEntryViewModel(timeEntryList);
            }

            viewModel.OnIsLoadingChanged += OnModelLoaded;
            viewModel.Init();
        }