You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have another page with a CollectionView who's template I define in another file under Views which contains a button.
The above 2 lines don't work in the DataTemplate and neither di the following.
.Invoke(cv => {
var tapGesture = new TapGestureRecognizer();
tapGesture.SetBinding(TapGestureRecognizer.CommandProperty, "TakeRightPictureForConsignmentCommand");
cv.GestureRecognizers.Add(tapGesture);
})
4).BindTapGesture( (ConsignmentPicturesViewModel vm) => vm.TakeRightPictureForConsignmentCommand)
5).Bind(Button.CommandProperty, getter: new Binding("TakeRightPictureForConsignmentCommand", source: new RelativeBindingSource(RelativeBindingSourceMode.FindAncestor, typeof(ConsignmentPicturesViewModel))))
6).Bind<Button, ConsignmentPicturesViewModel, ICommand>(
Button.CommandProperty,getter: (ConsignmentPicturesViewModel vm)=>vm.TakeRightPictureForConsignmentCommand,
new Binding("TakeRightPictureForConsignmentCommand",
source: new RelativeBindingSource(RelativeBindingSourceMode.FindAncestor,
typeof(DeliveryCollectionDetailsPageViewModel)))
.Bind<Button, ConsignmentPicturesViewModel, ICommand>(
Button.CommandProperty,getter: nameof(ConsignmentPicturesViewModel.TakeRightPictureForConsignmentCommand)),
new Binding("TakeRightPictureForConsignmentCommand",
source: new RelativeBindingSource(RelativeBindingSourceMode.FindAncestor,
typeof(DeliveryCollectionDetailsPageViewModel)))
Before I give up and re-write the page in Xaml, do you have any suggestions?
Thanks! 😊
The text was updated successfully, but these errors were encountered:
Hi,
I have a button in one page which works using markup with either these lines of code
I have another page with a CollectionView who's template I define in another file under Views which contains a button.
The above 2 lines don't work in the DataTemplate and neither di the following.
var tapGesture = new TapGestureRecognizer();
tapGesture.SetBinding(TapGestureRecognizer.CommandProperty, "TakeRightPictureForConsignmentCommand");
cv.GestureRecognizers.Add(tapGesture);
})
4).BindTapGesture( (ConsignmentPicturesViewModel vm) => vm.TakeRightPictureForConsignmentCommand)
5).Bind(Button.CommandProperty, getter: new Binding("TakeRightPictureForConsignmentCommand", source: new RelativeBindingSource(RelativeBindingSourceMode.FindAncestor, typeof(ConsignmentPicturesViewModel))))
6).Bind<Button, ConsignmentPicturesViewModel, ICommand>(
Button.CommandProperty,getter: (ConsignmentPicturesViewModel vm)=>vm.TakeRightPictureForConsignmentCommand,
new Binding("TakeRightPictureForConsignmentCommand",
source: new RelativeBindingSource(RelativeBindingSourceMode.FindAncestor,
typeof(DeliveryCollectionDetailsPageViewModel)))
Button.CommandProperty,getter: nameof(ConsignmentPicturesViewModel.TakeRightPictureForConsignmentCommand)),
new Binding("TakeRightPictureForConsignmentCommand",
source: new RelativeBindingSource(RelativeBindingSourceMode.FindAncestor,
typeof(DeliveryCollectionDetailsPageViewModel)))
Before I give up and re-write the page in Xaml, do you have any suggestions?
Thanks! 😊
The text was updated successfully, but these errors were encountered: