protected UseFullLinkCell(IntPtr handle) : base(handle) { UseFullLinkView = new UseFullLinkView(); Add(UseFullLinkView); this.DelayBind(OnCreateBinding); this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints(); this.AddConstraints(UseFullLinkView.FullHeightOf(this, 2)); this.AddConstraints(UseFullLinkView.WithSameWidth(this)); }
void OnCreateBinding() { var bindingSet = this.CreateBindingSet <UseFullLinkCell, UseFullLinkViewModel>(); bindingSet.Bind(UseFullLinkView.Name).For(v => v.Text).To(vm => vm.Name); bindingSet.Bind(UseFullLinkView.Logo).For(v => v.Image).To(vm => vm.Icon).WithConversion(new MvxInMemoryImageValueConverter()); bindingSet.Bind(UseFullLinkView.Tap()).For(v => v.Command).To(vm => vm.TapCommand); bindingSet.Apply(); }
void Initialize() { UseFullLinkView = new UseFullLinkView(); Add(UseFullLinkView); this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints(); this.AddConstraints(UseFullLinkView.FullHeightOf(this, 2)); this.AddConstraints(UseFullLinkView.WithSameWidth(this)); var tapGestureRecognizer = new UITapGestureRecognizer(OnTapped); this.AddGestureRecognizer(tapGestureRecognizer); }