Exemplo n.º 1
0
        private void BindComponents()
        {
            var bindingSet = this.CreateBindingSet <VacationItemViewHolder, VacationCoreModel>();

            bindingSet.Bind(_durationText)
            .For(d => d.Text)
            .To(x => x.Period);

            bindingSet.Bind(_typeText)
            .For(d => d.Text)
            .To(f => f.VacationType);

            bindingSet.Bind(_statusText)
            .For(d => d.Text)
            .To(f => f.VacationStatus);


            bindingSet.Bind(_toDetails)
            .To(f => f.DetailCommand);

            bindingSet.Apply();

            var typePicture = _typeText.Text;

            _picture.SetImageResource(VacationTypeSetting.GetPicture(typePicture));
        }
Exemplo n.º 2
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate(Resource.Layout.TypeRow, container, false);

            _image = view.FindViewById <ImageView>(Resource.Id.imageView1);
            _image.SetImageResource(VacationTypeSetting.GetPicture(_type.ToString()));
            _typeName      = view.FindViewById <TextView>(Resource.Id.textView1);
            _typeName.Text = _type.ToString();

            return(view);
        }
Exemplo n.º 3
0
        protected VacationTableViewCell(IntPtr handle) : base(handle)
        {
            this.DelayBind(() =>
            {
                var set = this.CreateBindingSet <VacationTableViewCell, VacationCoreModel>();

                set.Bind(Date).To(m => m.Period);

                set.Bind(Status).To(m => m.VacationStatus);

                set.Bind(Type).To(m => m.VacationType);

                set.Bind(DetailButton).To(m => m.DetailCommand);

                set.Apply();

                var typePicture = Type.Text;

                VacationPicture.Image = VacationTypeSetting.GetPicture(typePicture);
            });
        }
Exemplo n.º 4
0
        private void ApplyBindings()
        {
            var bindingSet = this.CreateBindingSet <DetailVacationView, DetailViewModel>();

            var saveItem = new UIBarButtonItem(UIBarButtonSystemItem.Save);

            bindingSet.Bind(saveItem).
            To(vm => vm.SaveCommand);

            NavigationItem.RightBarButtonItem = saveItem;

            bindingSet.Bind(StartDay)
            .For("Title")
            .To(vm => vm.StartDay);

            bindingSet.Bind(StartMonth)
            .For("Title")
            .To(vm => vm.StartMonth);

            bindingSet.Bind(StartYear)
            .For("Title")
            .To(vm => vm.StartYear);

            bindingSet.Bind(EndDay)
            .For("Title")
            .To(vm => vm.EndDay);

            bindingSet.Bind(EndMonth)
            .For("Title")
            .To(vm => vm.EndMonth);

            bindingSet.Bind(EndYear)
            .For("Title")
            .To(vm => vm.EndYear);

            bindingSet.Bind(StatusSegment)
            .For("SelectedSegment")
            .To(vm => vm.StatusButtonSelectedSegment)
            .WithConversion("StatusToNumber");

            bindingSet.Bind(TypeText)
            .For("Text")
            .To(vm => vm.TypeText);

            bindingSet.Bind(Page)
            .For("CurrentPage")
            .To(vm => vm.Page);

            bindingSet.Bind(StatusSegment)
            .For("ValueChanged")
            .To(vm => vm.ChangeStatusCommand);

            bindingSet.Bind(DoneButton)
            .To(vm => vm.DoneCommand);

            bindingSet.Bind(DateToolBar)
            .To(vm => vm.CancelCommand);

            bindingSet.Bind(DatePickerVacation)
            .For("Hidden")
            .To(vm => vm.IsDatePickerVacation);

            bindingSet.Bind(DatePickerBar)
            .For("Hidden")
            .To(vm => vm.IsDatePickerToolbar);

            bindingSet.Bind(DatePickerVacation)
            .For("Date")
            .To(vm => vm.DatePickerVacationDate);

            bindingSet.Bind(StartDay)
            .To(vm => vm.StartDateCommand);

            bindingSet.Bind(StartMonth)
            .To(vm => vm.StartDateCommand);

            bindingSet.Bind(StartYear)
            .To(vm => vm.StartDateCommand);

            bindingSet.Bind(EndDay)
            .To(vm => vm.EndDateCommand);

            bindingSet.Bind(EndMonth)
            .To(vm => vm.EndDateCommand);

            bindingSet.Bind(EndYear)
            .To(vm => vm.EndDateCommand);

            bindingSet.Bind(Page)
            .For("ValueChanged")
            .To(vm => vm.SwipeEventCommand);

            bindingSet.Apply();

            var numPage = (int)Page.CurrentPage;

            var vacationType = (VacationType)numPage;

            PageImage.Image = VacationTypeSetting.GetPicture(vacationType.ToString());
        }