public async override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); ViewModel = await NewProjectViewModel.Init(WorkspaceId); clientBinding = this.SetBinding(() => ViewModel.ClientName, () => SelectClientBit.TextField.Text); }
public async override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); ViewModel = await NewProjectViewModel.Init(WorkspaceId); clientBinding = this.SetBinding(() => ViewModel.ClientName, () => SelectClientBit.TextField.Text); nameBinding = this.SetBinding(() => ViewModel.ProjectName, () => ProjectBit.TextField.Text, BindingMode.TwoWay); colorBinding = this.SetBinding(() => ViewModel.ProjectColor, () => ColorPicker.Adapter.SelectedColor, BindingMode.TwoWay).UpdateTargetTrigger("SelectedColorChanged"); }
public async override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); if (viewModel == null) { var timeEntryList = BaseActivity.GetDataFromIntent <List <TimeEntryData> > (Activity.Intent, NewProjectActivity.ExtraTimeEntryDataListId); viewModel = new NewProjectViewModel(timeEntryList); } viewModel.OnIsLoadingChanged += OnModelLoaded; await viewModel.Init(); }
public async override void ViewDidLoad() { base.ViewDidLoad(); ViewModel = await NewProjectViewModel.Init(workspaceId); clientBinding = this.SetBinding(() => ViewModel.ClientName).WhenSourceChanges(() => { var name = string.IsNullOrEmpty(ViewModel.ClientName) ? "NewProjectClientHint".Tr() : ViewModel.ClientName; if (string.IsNullOrEmpty(ViewModel.ClientName)) { clientButton.Apply(Style.NewProject.ClientButton).Apply(Style.NewProject.NoClient); } else { clientButton.Apply(Style.NewProject.WithClient); } clientButton.SetTitle(name, UIControlState.Normal); }); }