Ejemplo n.º 1
0
        private void Binding()
        {
            var set = this.CreateBindingSet <FriendView, FriendViewModel>();

            set.Bind(UserName).For(u => u.Text).To(vm => vm.UserName).Apply();
            set.Bind(UserAge).For(u => u.Text).To(vm => vm.UserAge).Apply();
            set.Bind(UserDate).For(u => u.Text).To(vm => vm.DateReg).Apply();
            set.Bind(UserEmail).For(u => u.Text).To(vm => vm.Email).Apply();
            set.Bind(UserPhone).For(u => u.Text).To(vm => vm.Phone).Apply();
            set.Bind(UserAddress).For(u => u.Text).To(vm => vm.Address).Apply();
            set.Bind(Coordinates).For(u => u.Text).To(vm => vm.Coordinates).Apply();
            set.Bind(About).For(u => u.Text).To(vm => vm.About).Apply();
            set.Bind(FriendsListTitle).For(u => u.Text).To(vm => vm.FriendsListTitle).Apply();
            set.Bind(UserEmail.Tap()).For(u => u.Command).To(vm => vm.SendEmailCommand).Apply();
            set.Bind(UserPhone.Tap()).For(u => u.Command).To(vm => vm.CallCommand).Apply();
            set.Bind(Coordinates.Tap()).For(u => u.Command).To(vm => vm.ShowMapCommand).Apply();
            set.Bind(Figure).For(v => v.Image).To(vm => vm.Figure).WithConversion <FigureResourceConvertor>().Apply();
            set.Bind(Status).For(v => v.BackgroundColor).To(vm => vm.StatusColor).WithConversion <StatusColorConvertor>().Apply();
            set.Bind(_source).To(vm => vm.Users).Apply();
            set.Bind(_source).For(s => s.SelectionChangedCommand).To(vm => vm.SelectUserСommand).Apply();
        }