コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: NewProjectFragment.cs プロジェクト: uthens/mobile
        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");
        }
コード例 #3
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();
        }
コード例 #4
0
        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);
            });
        }