public async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); viewModel = await TagListViewModel.Init(WorkspaceId, ExistingTagIds); SetPreviousSelectedTags(); }
public async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); if (viewModel == null) { var timeEntryList = await TimeEntryGroup.GetTimeEntryDataList(TimeEntryIds); viewModel = new TagListViewModel(WorkspaceId, timeEntryList); } viewModel.OnIsLoadingChanged += OnModelLoaded; viewModel.Init(); if (viewModel.Model.Workspace == null || viewModel.Model.Workspace.Id == Guid.Empty) { Dismiss(); } }
public async override void ViewDidLoad() { base.ViewDidLoad(); View.Apply(Style.Screen); EdgesForExtendedLayout = UIRectEdge.None; viewModel = await TagListViewModel.Init(workspaceId, previousSelectedTags.Select (t => t.Id).ToList()); // Set ObservableTableViewController settings // ObservableTableViewController is a helper class // from Mvvm light package. TableView.RowHeight = 60f; TableView.SeparatorStyle = UITableViewCellSeparatorStyle.None; CreateCellDelegate = CreateTagCell; BindCellDelegate = BindCell; DataSource = viewModel.TagCollection; var addBtn = new UIBarButtonItem(UIBarButtonSystemItem.Add, OnAddNewTag); var saveBtn = new UIBarButtonItem("TagSet".Tr(), UIBarButtonItemStyle.Plain, OnSaveBtn).Apply(Style.NavLabelButton); NavigationItem.RightBarButtonItems = new [] { saveBtn, addBtn }; }