2 using Tizen.NUI.BaseComponents;
3 using Tizen.NUI.Components;
5 namespace NUITizenGallery
7 public partial class TapGestureTest2Page : ContentPage
9 private TapGestureDetector tapDetector;
11 private Vector3 initScale;
13 public TapGestureTest2Page()
15 InitializeComponent();
16 ContentView.Padding = new Extents(20, 20, 20, 20);
18 initScale = imageView.Scale;
20 text1.Text = " Tap the image!\n Onte tap: Rotate 45 degrees\n Two taps: Increase scale by 0.5\n Three taps: Reset the image\n";
22 tapDetector = new TapGestureDetector();
23 tapDetector.SetMaximumTapsRequired(3);
25 tapDetector.Attach(imageView);
27 tapDetector.Detected += (obj, e) =>
29 if (e.TapGesture.NumberOfTaps == 1)
32 int rotation = tapCount % 8;
33 imageView.Orientation = new Rotation(new Radian(new Degree(45 * rotation)), new Vector3(0f, 0f, 1f));
35 else if (e.TapGesture.NumberOfTaps == 2)
37 imageView.Scale = imageView.Scale * new Vector3(1.5f, 1.5f, 1.0f);
39 else if (e.TapGesture.NumberOfTaps == 3)
41 imageView.Scale = initScale;
42 imageView.Orientation = new Rotation(new Radian(new Degree(0)), new Vector3(0f, 0f, 1f));