ec9427493410341612a46c9049f3ede30a847457
[test/tct/csharp/api.git] /
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Linq;\r
4 using System.Text;\r
5 \r
6 using Xamarin.Forms;\r
7 \r
8 namespace EventListener\r
9 {\r
10     public class App : Application\r
11     {\r
12         public interface IAppEvent\r
13         {\r
14             void OnButtonPressed();\r
15         }\r
16         public IAppEvent AppEvent { get; set; }\r
17 \r
18 \r
19         public App()\r
20         {\r
21             Button eButton = new Button\r
22             {\r
23                 HorizontalOptions = LayoutOptions.Center,\r
24                 Text = "EXIT",\r
25                 FontSize = 15,\r
26                 WidthRequest = 330,\r
27                 HeightRequest = 80\r
28             };\r
29 \r
30             eButton.Clicked += (sender, e) =>\r
31             {\r
32                 AppEvent?.OnButtonPressed();\r
33             };\r
34 \r
35             // The root page of your application\r
36             MainPage = new ContentPage\r
37             {\r
38                 Content = new StackLayout\r
39                 {\r
40                     VerticalOptions = LayoutOptions.Center,\r
41                     Children = {\r
42                         new Label {\r
43                             HorizontalTextAlignment = TextAlignment.Center,\r
44                             Text = "org.tizen.example.EventListener.Tizen"\r
45                         },\r
46                         eButton\r
47                     }\r
48                 }\r
49             };\r
50         }\r
51 \r
52         protected override void OnStart()\r
53         {\r
54             // Handle when your app starts\r
55         }\r
56 \r
57         protected override void OnSleep()\r
58         {\r
59             // Handle when your app sleeps\r
60         }\r
61 \r
62         protected override void OnResume()\r
63         {\r
64             // Handle when your app resumes\r
65         }\r
66     }\r
67 }\r