protected override void OnAttached() { // Get the Android View corresponding to the Element that the effect is attached to view = Control == null ? Container : Control; // Get access to the TouchEffect class in the .NET Standard library SkiaSharp_Samples.Xaml.TouchEffect touchEffect = (SkiaSharp_Samples.Xaml.TouchEffect)Element.Effects. FirstOrDefault(e => e is SkiaSharp_Samples.Xaml.TouchEffect); if (touchEffect != null && view != null) { viewDictionary.Add(view, this); formsElement = Element; libTouchEffect = touchEffect; // Save fromPixels function fromPixels = view.Context.FromPixels; // Set event handler on View view.Touch += OnTouch; } }
public TouchRecognizer(Element element, UIView view, SkiaSharp_Samples.Xaml.TouchEffect touchEffect) { this.element = element; this.view = view; this.touchEffect = touchEffect; viewDictionary.Add(view, this); }