2 using Tizen.NUI.BaseComponents;
3 using Tizen.NUI.Components;
5 namespace NUITizenGallery
7 public partial class SwipeViewTest2Page : ContentPage
9 private PanGestureDetector panGestureDetector;
10 private Position init1Position;
11 private Position init2Position;
13 public SwipeViewTest2Page()
15 InitializeComponent();
17 panGestureDetector = new PanGestureDetector();
18 panGestureDetector.Attach(text1View);
19 panGestureDetector.Attach(text2View);
20 panGestureDetector.Detected += (obj, e) =>
22 Vector2 velocity = e.PanGesture.Velocity;
26 if (e.PanGesture.State == Gesture.StateType.Started)
28 init1Position = text1View.Position;
29 init2Position = text2View.Position;
31 else if (e.PanGesture.State == Gesture.StateType.Finished || e.PanGesture.State == Gesture.StateType.Cancelled)
33 if(view.Position.X < - 110)
35 var button = new Button()
40 button.Clicked += (object s, ClickedEventArgs a) =>
45 if (view == text1View)
47 DialogPage.ShowAlertDialog("SwipeView", "SwipeItemView Invoked", button);
49 else if (view == text2View)
51 DialogPage.ShowAlertDialog("SwipeView", "SwipeItemView Command Executed", button);
55 text1View.Position = init1Position;
56 text2View.Position = init2Position;
60 if (velocity.X < 0 && view.Position.X > -140)
62 view.Position += new Position(e.PanGesture.ScreenDisplacement.X, 0, 0);