Пример #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootView = inflater.Inflate(Resource.Layout.TaskEdit, container, false);

            taskTitle = rootView.FindViewById <EditText> (Resource.Id.taskTitle);
            taskNote  = rootView.FindViewById <EditText> (Resource.Id.taskNote);

            taskAlarmList         = rootView.FindViewById <ListView> (Resource.Id.taskAlarmList);
            alarmAdapter          = new AlarmAdapter(inflater, alarmList);
            taskAlarmList.Adapter = alarmAdapter;

            taskAlarmList.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
//				Toast.MakeText(Activity, "hoge", ToastLength.Long);
                currentAlarmPosition = e.Position;
                var df = new TimePickerFragment(this);
                df.Show(this.FragmentManager, "timePicker");
            };

            taskTitle.Text = ViewModel.SelectedTask.Title;
            taskNote.Text  = ViewModel.SelectedTask.Note;

            // after text changed: viewmodel sync
            taskTitle.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) => { ViewModel.SelectedTask.Title = taskTitle.Text; };
            taskNote.AfterTextChanged  += (object sender, Android.Text.AfterTextChangedEventArgs e) => { ViewModel.SelectedTask.Note = taskNote.Text; };

            return(rootView);
        }
Пример #2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootView = inflater.Inflate (Resource.Layout.TaskEdit, container, false);

            taskTitle = rootView.FindViewById<EditText> (Resource.Id.taskTitle);
            taskNote = rootView.FindViewById<EditText> (Resource.Id.taskNote);

            taskAlarmList = rootView.FindViewById<ListView> (Resource.Id.taskAlarmList);
            alarmAdapter = new AlarmAdapter (inflater, alarmList);
            taskAlarmList.Adapter = alarmAdapter;

            taskAlarmList.ItemClick += (object sender, AdapterView.ItemClickEventArgs e) => {
            //				Toast.MakeText(Activity, "hoge", ToastLength.Long);
                currentAlarmPosition = e.Position;
                var df = new TimePickerFragment(this);
                df.Show(this.FragmentManager, "timePicker");
            };

            taskTitle.Text = ViewModel.SelectedTask.Title;
            taskNote.Text = ViewModel.SelectedTask.Note;

            // after text changed: viewmodel sync
            taskTitle.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) => { ViewModel.SelectedTask.Title = taskTitle.Text; };
            taskNote.AfterTextChanged += (object sender, Android.Text.AfterTextChangedEventArgs e) => { ViewModel.SelectedTask.Note = taskNote.Text; };

            return rootView;
        }