public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.Inflate(Resource.Layout.MainInbox, container, false); inboxList = rootView.FindViewById <ListView> (Resource.Id.InboxTaskList); taskAdapter = new TaskAdapter(inflater, ViewModel.Tasks); inboxList.Adapter = taskAdapter; inboxList.ItemClick += (sender, e) => { ViewModel.SelectTask(e.Position); if (ViewModel.SelectedTask != null) { Intent intent = new Intent(rootView.Context, typeof(TaskEditActivity)); StartActivity(intent); } }; inboxList.ItemLongClick += (object sender, AdapterView.ItemLongClickEventArgs e) => { ViewModel.SelectTask(e.Position); ViewModel.StartSelectedTask(); ViewModel.UnselectTask(); Activity.ActionBar.SetSelectedNavigationItem(0); Activity.InvalidateOptionsMenu(); }; return(rootView); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.Inflate(Resource.Layout.MainNext, container, false); nextList = rootView.FindViewById <ListView> (Resource.Id.NextTaskList); taskAdapter = new TaskAdapter(inflater, ViewModel.Tasks); nextList.Adapter = taskAdapter; nextList.ItemClick += (sender, e) => { ViewModel.SelectTask(e.Position); if (ViewModel.SelectedTask != null) { Intent intent = new Intent(rootView.Context, typeof(TaskInfoActivity)); StartActivity(intent); } }; return(rootView); }