Пример #1
0
        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);
            });
        }
 public NewProjectFragment (List<TimeEntryData> timeEntryList)
 {
     viewModel = new NewProjectViewModel (timeEntryList);
 }
Пример #4
0
        public async override void OnViewCreated (View view, Bundle savedInstanceState)
        {
            base.OnViewCreated (view, savedInstanceState);

            ViewModel = new NewProjectViewModel (TimeEntryList);

            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");

            await ViewModel.Init ();
        }