summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.iOS
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.ControlGallery.iOS')
-rw-r--r--Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj1
-rw-r--r--Xamarin.Forms.ControlGallery.iOS/_57114Renderer.cs44
2 files changed, 45 insertions, 0 deletions
diff --git a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
index 00d23ec..9ed9b17 100644
--- a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
+++ b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj
@@ -164,6 +164,7 @@
<Compile Include="CustomRenderer40251.cs" />
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
+ <Compile Include="_57114Renderer.cs" />
<None Include="app.config" />
<None Include="Info.plist" />
<Compile Include="Properties\AssemblyInfo.cs" />
diff --git a/Xamarin.Forms.ControlGallery.iOS/_57114Renderer.cs b/Xamarin.Forms.ControlGallery.iOS/_57114Renderer.cs
new file mode 100644
index 0000000..f246fa7
--- /dev/null
+++ b/Xamarin.Forms.ControlGallery.iOS/_57114Renderer.cs
@@ -0,0 +1,44 @@
+using System;
+using Foundation;
+using UIKit;
+using Xamarin.Forms;
+using Xamarin.Forms.ControlGallery.iOS;
+using Xamarin.Forms.Controls.Issues;
+using Xamarin.Forms.Platform.iOS;
+
+[assembly: ExportRenderer(typeof(Bugzilla57114._57114View), typeof(_57114Renderer))]
+
+namespace Xamarin.Forms.ControlGallery.iOS
+{
+ public class _57114Renderer : ViewRenderer<Bugzilla57114._57114View, _57114NativeView>
+ {
+ protected override void OnElementChanged(ElementChangedEventArgs<Bugzilla57114._57114View> e)
+ {
+ if (e.NewElement != null && Control == null)
+ {
+ var view = new _57114NativeView();
+ SetNativeControl(view);
+ }
+
+ base.OnElementChanged(e);
+ }
+ }
+
+ public class _57114NativeView : UIView, IUIGestureRecognizerDelegate
+ {
+ public _57114NativeView()
+ {
+ var rec = new CustomGestureRecognizer();
+ AddGestureRecognizer(rec);
+ }
+ }
+
+ public class CustomGestureRecognizer : UIGestureRecognizer
+ {
+ public override void TouchesBegan(NSSet touches, UIEvent evt)
+ {
+ base.TouchesBegan(touches, evt);
+ MessagingCenter.Instance.Send(this as object, Bugzilla57114._57114NativeGestureFiredMessage);
+ }
+ }
+} \ No newline at end of file