Created
December 31, 2021 09:12
-
-
Save bbenetskyy/78c9ce57f1b402539e7998f864468476 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region Protected Methods | |
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) | |
{ | |
base.OnElementPropertyChanged(sender, e); | |
if (e.PropertyName == Xamarin.Forms.VisualElement.XProperty.PropertyName || e.PropertyName == Xamarin.Forms.VisualElement.YProperty.PropertyName) | |
{ | |
CancellationToken(() => | |
{ | |
var draggableView = Element as DraggableView; | |
if(draggableView is null) | |
return; | |
Element.TranslationX = draggableView.NewX; | |
Element.TranslationY = draggableView.NewY; | |
}); | |
} | |
} | |
#endregion Protected Methods |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment