2bb8b860ef644cf4d6bc304aa4d2faad730e023d
[platform/core/csapi/nui.git] / NUISamples / NUISamples.TizenTV / NUISamples.TizenTV.cs
1 /*\r
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  * http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  *\r
16  */\r
17 \r
18 using System;\r
19 using System.Runtime.InteropServices;\r
20 using Tizen.NUI;\r
21 \r
22 namespace MyCSharpExample\r
23 {\r
24     class Example\r
25     {\r
26         // This is simple structure to contain Control name and implement state at once\r
27         // name : control name\r
28         // isImplemented : the state which the control is implemented in public or not\r
29         private struct Item\r
30         {\r
31             public String name;\r
32             public bool isImplemented;\r
33 \r
34             public Item(String name, bool isImplemented)\r
35             {\r
36                 this.name = name;\r
37                 this.isImplemented = isImplemented;\r
38             }\r
39         }\r
40 \r
41         private Application _application;\r
42         private TableView _contentContainer;\r
43         private Stage _stage;\r
44         private Popup _popup;\r
45         private Timer _timer;\r
46 \r
47         // List of items\r
48         private Item[] mViewList = {\r
49       new Item("PushButton", true),  new Item("DropDown", false),    new Item("Toggle", true),\r
50       new Item("InputField", false),  new Item("AnimateGif", false),  new Item("Loading", false),\r
51       new Item("ProgressBar", false), new Item("CheckBox", false),    new Item("RadioButton", true),\r
52       new Item("Tooltip", true),     new Item("Popup", true),       new Item("Toast", true),\r
53       new Item("ItemView", false),    new Item("CheckBox", true)\r
54     };\r
55 \r
56         public Example(Application application)\r
57         {\r
58             _application = application;\r
59             _application.Initialized += OnInitialize;\r
60         }\r
61 \r
62         public void OnInitialize(object source, NUIApplicationInitEventArgs e)\r
63         {\r
64             Tizen.Log.Debug("NUI", "Customized Application Initialize event handler");\r
65             _stage = Stage.Instance;\r
66             _stage.BackgroundColor = Color.White;\r
67 \r
68             // Top label\r
69             TextLabel topLabel = new TextLabel();\r
70             topLabel.WidthResizePolicy = ResizePolicyType.FillToParent;\r
71             topLabel.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;\r
72             topLabel.AnchorPoint = AnchorPoint.TopCenter;\r
73             topLabel.ParentOrigin = ParentOrigin.TopCenter;\r
74             topLabel.SizeModeFactor = new Vector3(0.0f, 0.1f, 0.0f);\r
75             topLabel.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f);\r
76             topLabel.TextColor = Color.Yellow;\r
77             topLabel.Text = " DALi Views Ver.0216-01";\r
78             topLabel.HorizontalAlignment = "BEGIN";\r
79             topLabel.VerticalAlignment = "CENTER";\r
80 \r
81             topLabel.FontFamily = "BreezeSans";\r
82             PropertyMap _map = new PropertyMap();\r
83             _map.Add("width", new PropertyValue("regular"));\r
84             _map.Add("weight", new PropertyValue("bold"));\r
85             _map.Add("slant", new PropertyValue("italic"));\r
86             topLabel.FontStyle = _map;\r
87             topLabel.PointSize = 15.0f;\r
88 \r
89             _stage.GetDefaultLayer().Add(topLabel);\r
90 \r
91             // Grid container to contain items. Use tableView because FlexContainer support focus navigation just two direction ( up/down or left/right )\r
92             _contentContainer = new TableView(6, 5);\r
93             _contentContainer.WidthResizePolicy = ResizePolicyType.FillToParent;\r
94             _contentContainer.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;\r
95             _contentContainer.SizeModeFactor = new Vector3(0.0f, 0.9f, 0.0f);\r
96             _contentContainer.AnchorPoint = AnchorPoint.BottomCenter;\r
97             _contentContainer.ParentOrigin = ParentOrigin.BottomCenter;\r
98             _contentContainer.SetRelativeHeight(0, 0.07f);\r
99             _contentContainer.SetRelativeHeight(1, 0.26f);\r
100             _contentContainer.SetRelativeHeight(2, 0.07f);\r
101             _contentContainer.SetRelativeHeight(3, 0.26f);\r
102             _contentContainer.SetRelativeHeight(4, 0.07f);\r
103             _contentContainer.SetRelativeHeight(5, 0.26f);\r
104             _contentContainer.Focusable = true;\r
105             _stage.GetDefaultLayer().Add(_contentContainer);\r
106 \r
107             CreateContent();\r
108 \r
109             FocusManager.Instance.PreFocusChange += OnPreFocusChange;\r
110 \r
111             _timer = new Timer(500);\r
112             _timer.Tick += OnTimerTick;\r
113             _timer.Start();\r
114 \r
115 \r
116             View _testView = new View();\r
117             Tizen.Log.Debug("NUI", "1) test view sizewidth = " + _testView.SizeWidth + "  sizeHeight= " + _testView.SizeHeight);\r
118             _testView.Size = new Size(1.0f, 2.0f, 0.0f);\r
119             Tizen.Log.Debug("NUI", "2) test view sizewidth = " + _testView.SizeWidth + "  sizeHeight= " + _testView.SizeHeight);\r
120             _testView.WidthResizePolicy = ResizePolicyType.Fixed;\r
121             _testView.HeightResizePolicy = ResizePolicyType.Fixed;\r
122             _testView.Size = new Size(1.0f, 2.0f, 0.0f);\r
123             Tizen.Log.Debug("NUI", "3) test view sizewidth = " + _testView.SizeWidth + "  sizeHeight= " + _testView.SizeHeight);\r
124 \r
125 #if false\r
126             Window _win = new Window(new RectInteger(100, 100, 500, 500), "win test", false);\r
127             Window _win = _application.GetWindow();\r
128             _win.Activate();\r
129             _win.ShowIndicator(Window.IndicatorVisibleMode.VISIBLE);\r
130             _win.SetIndicatorBgOpacity(Window.IndicatorBgOpacity.OPAQUE);\r
131             Any _any = _win.GetNativeHandle();\r
132 #endif\r
133         }\r
134 \r
135         private bool OnTimerTick(object sender, EventArgs e)\r
136         {\r
137             Tizen.Log.Debug("NUI", "OnTimerTick() is called!");\r
138             return true;\r
139         }\r
140 \r
141         // Callback for KeyboardFocusManager\r
142         private View OnPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e)\r
143         {\r
144             if (!e.ProposedView && !e.CurrentView)\r
145             {\r
146                 e.ProposedView = View.DownCast(_contentContainer.GetChildAt(1));\r
147             }\r
148             return e.ProposedView;\r
149         }\r
150 \r
151         private void CreateContent()\r
152         {\r
153             for (int i = 0; i < mViewList.Length; i++)\r
154             {\r
155                 CreateItem(mViewList[i], i);\r
156             }\r
157         }\r
158 \r
159         private void CreateItem(Item item, int idx)\r
160         {\r
161             // Make label for item\r
162             TextLabel itemLabel = new TextLabel("    " + item.name);\r
163             itemLabel.Size = new Size(_stage.Size.Width * 0.2f, _stage.Size.Height * 0.05f, 0.0f);\r
164             itemLabel.HorizontalAlignment = "BEGIN";\r
165             itemLabel.VerticalAlignment = "BOTTOM";\r
166             //itemLabel.PointSize = 10.0f;\r
167             _contentContainer.AddChild(itemLabel, new TableView.CellPosition(((uint)idx / 5) * 2, (uint)idx % 5));\r
168 \r
169             // If item is implemented in public, attach it on stage\r
170             if (item.isImplemented)\r
171             {\r
172                 if (item.name.CompareTo("PushButton") == 0)\r
173                 {\r
174                     PushButton pushButton = new PushButton();\r
175                     pushButton.LabelText = "Push Button";\r
176                     pushButton.WidthResizePolicy = ResizePolicyType.FillToParent;\r
177                     pushButton.HeightResizePolicy = ResizePolicyType.FillToParent;\r
178                     pushButton.UnselectedColor = new Color(1.0f, 0.0f, 0.0f, 1.0f);\r
179                     pushButton.SelectedColor = new Color(0.0f, 1.0f, 0.0f, 1.0f);\r
180                     pushButton.Clicked += (obj, e) =>\r
181                     {\r
182                         Button sender = (Button)(obj);\r
183                         sender.LabelText = "Click Me";\r
184                         sender.UnselectedColor = new Color(0.0f, 0.0f, 1.0f, 1.0f);\r
185                         return true;\r
186                     };\r
187 \r
188                     _contentContainer.AddChild(pushButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
189                 }\r
190                 if (item.name.CompareTo("DropDown") == 0)\r
191                 {\r
192 \r
193                 }\r
194                 if (item.name.CompareTo("Toggle") == 0)\r
195                 {\r
196                     ToggleButton toggleButton = new ToggleButton();\r
197                     Tizen.NUI.PropertyArray array = new Tizen.NUI.PropertyArray();\r
198                     array.Add(new Tizen.NUI.PropertyValue("/home/owner/apps_rw/NUISamples.TizenTV/res/images/star-highlight.png"));\r
199                     array.Add(new Tizen.NUI.PropertyValue("/home/owner/apps_rw/NUISamples.TizenTV/res/images/star-mod.png"));\r
200                     array.Add(new Tizen.NUI.PropertyValue("/home/owner/apps_rw/NUISamples.TizenTV/res/images/star-dim.png"));\r
201                     toggleButton.StateVisuals = array;\r
202 \r
203                     Tizen.NUI.PropertyArray tooltips = new Tizen.NUI.PropertyArray();\r
204                     tooltips.Add(new Tizen.NUI.PropertyValue("State A"));\r
205                     tooltips.Add(new Tizen.NUI.PropertyValue("State B"));\r
206                     tooltips.Add(new Tizen.NUI.PropertyValue("State C"));\r
207                     toggleButton.Tooltips = tooltips;\r
208 \r
209                     toggleButton.WidthResizePolicy = ResizePolicyType.FillToParent;\r
210                     toggleButton.HeightResizePolicy = ResizePolicyType.FillToParent;\r
211                     toggleButton.Clicked += (obj, e) =>\r
212                     {\r
213                         Console.WriteLine("Toggle button state changed.");\r
214                         return true;\r
215                     };\r
216 \r
217                     _contentContainer.AddChild(toggleButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
218                 }\r
219                 if (item.name.CompareTo("InputField") == 0)\r
220                 {\r
221 \r
222                 }\r
223                 if (item.name.CompareTo("AnimateGif") == 0)\r
224                 {\r
225 \r
226                 }\r
227                 if (item.name.CompareTo("Loading") == 0)\r
228                 {\r
229 \r
230                 }\r
231                 if (item.name.CompareTo("ProgressBar") == 0)\r
232                 {\r
233 \r
234                 }\r
235                 if (item.name.CompareTo("ScrollBar") == 0)\r
236                 {\r
237 \r
238                 }\r
239                 if (item.name.CompareTo("CheckBox") == 0)\r
240                 {\r
241                     CheckBoxButton checkBoxButton = new CheckBoxButton();\r
242                     checkBoxButton.LabelText = "Yes";\r
243 \r
244                     _contentContainer.AddChild(checkBoxButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
245                 }\r
246                 if (item.name.CompareTo("RadioButton") == 0)\r
247                 {\r
248                     TableView tableView = new TableView(2, 1);\r
249                     tableView.WidthResizePolicy = ResizePolicyType.FillToParent;\r
250                     tableView.HeightResizePolicy = ResizePolicyType.FillToParent;\r
251 \r
252                     RadioButton rButton = new RadioButton();\r
253                     rButton.LabelText = "Yes";\r
254                     rButton.Selected = true;\r
255                     tableView.AddChild(rButton, new TableView.CellPosition(0, 0));\r
256 \r
257                     rButton = new RadioButton();\r
258                     rButton.LabelText = "No";\r
259 \r
260                     tableView.AddChild(rButton, new TableView.CellPosition(1, 0));\r
261 \r
262                     _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
263                 }\r
264                 if (item.name.CompareTo("Tooltip") == 0)\r
265                 {\r
266                     TableView tableView = new TableView(2, 1);\r
267                     tableView.WidthResizePolicy = ResizePolicyType.FillToParent;\r
268                     tableView.HeightResizePolicy = ResizePolicyType.FillToParent;\r
269 \r
270                     // Create two push buttons and add them to a table view\r
271                     PushButton buttonWithSimpleTooltip = new PushButton();\r
272                     buttonWithSimpleTooltip.LabelText = "Tooltip with text only";\r
273                     buttonWithSimpleTooltip.UnselectedColor = new Color(0.5f, 0.5f, 0.7f, 1.0f);\r
274                     buttonWithSimpleTooltip.SelectedColor = new Color(0.7f, 0.5f, 0.7f, 1.0f);\r
275                     buttonWithSimpleTooltip.WidthResizePolicy = ResizePolicyType.FillToParent;\r
276                     tableView.AddChild(buttonWithSimpleTooltip, new TableView.CellPosition(0, 0));\r
277 \r
278                     PushButton buttonWithIconTooltip = new PushButton();\r
279                     buttonWithIconTooltip.LabelText = "Tooltip with Text and Icon";\r
280                     buttonWithIconTooltip.WidthResizePolicy = ResizePolicyType.FillToParent;\r
281                     buttonWithIconTooltip.UnselectedColor = new Color(0.5f, 0.5f, 0.7f, 1.0f);\r
282                     buttonWithIconTooltip.SelectedColor = new Color(0.7f, 0.5f, 0.7f, 1.0f);\r
283                     tableView.AddChild(buttonWithIconTooltip, new TableView.CellPosition(1, 0));\r
284 \r
285                     // Add a simple text only tooltip to the first push button\r
286                     buttonWithSimpleTooltip.TooltipText = "Simple Tooltip";\r
287 \r
288                     // Create a property map for a tooltip with one icon and one text\r
289                     PropertyArray iconTooltipContent = new PropertyArray();\r
290 \r
291                     PropertyMap iconVisual = new PropertyMap();\r
292                     iconVisual.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Image))\r
293                       .Add(Tizen.NUI.Constants.ImageVisualProperty.URL, new PropertyValue("/home/owner/apps_rw/NUISamples.TizenTV/res/images/star-highlight.png"));\r
294                     iconTooltipContent.Add(new PropertyValue(iconVisual));\r
295 \r
296                     PropertyMap textVisual = new PropertyMap();\r
297                     textVisual.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Text))\r
298                       .Add(Tizen.NUI.Constants.TextVisualProperty.Text, new PropertyValue("Tooltip with Icon"));\r
299                     iconTooltipContent.Add(new PropertyValue(textVisual));\r
300 \r
301                     PropertyMap iconTooltip = new PropertyMap();\r
302                     iconTooltip.Add(Tizen.NUI.Constants.Tooltip.Property.Content, new PropertyValue(iconTooltipContent))\r
303                       .Add(Tizen.NUI.Constants.Tooltip.Property.Tail, new PropertyValue(true));\r
304 \r
305                     // Add the tooltip with icon and text to the second push button\r
306                     buttonWithIconTooltip.Tooltip = iconTooltip;\r
307 \r
308                     _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
309                 }\r
310                 if (item.name.CompareTo("Popup") == 0)\r
311                 {\r
312                     PushButton button = new PushButton();\r
313                     button.LabelText = "Popup";\r
314                     button.ParentOrigin = ParentOrigin.Center;\r
315                     button.AnchorPoint = AnchorPoint.Center;\r
316                     //button.MaximumSize = new Vector2(90.0f,50.0f);\r
317                     _popup = CreatePopup();\r
318                     _popup.SetTitle(CreateTitle("Popup"));\r
319 \r
320                     TextLabel text = new TextLabel("This will erase the file permanently. Are you sure?");\r
321                     text.MixColor = Color.White;\r
322                     text.MultiLine = true;\r
323                     text.WidthResizePolicy = ResizePolicyType.FillToParent;\r
324                     text.HeightResizePolicy = ResizePolicyType.DimensionDependency;\r
325                     text.Padding = new Vector4(10.0f, 10.0f, 20.0f, 0.0f);\r
326                     _popup.SetContent(text);\r
327                     _popup.Focusable = true;\r
328                     _popup.SetDisplayState(Popup.DisplayStateType.Hidden);\r
329 \r
330                     button.Clicked += (obj, ee) =>\r
331                     {\r
332                         _stage.GetDefaultLayer().Add(_popup);\r
333                         _popup.SetDisplayState(Popup.DisplayStateType.Shown);\r
334                         FocusManager.Instance.SetCurrentFocusView(View.DownCast((_popup.FindChildByName("Footer")).FindChildByName("OKButton")));\r
335                         return true;\r
336                     };\r
337                     _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
338                 }\r
339                 if (item.name.CompareTo("Toast") == 0)\r
340                 {\r
341                     PushButton button = new PushButton();\r
342                     button.LabelText = "Toast";\r
343                     button.ParentOrigin = ParentOrigin.Center;\r
344                     button.AnchorPoint = AnchorPoint.Center;\r
345                     button.Clicked += (obj, ee) =>\r
346                     {\r
347                         TypeInfo typeInfo = new TypeInfo(TypeRegistry.Get().GetTypeInfo("PopupToast"));\r
348                         if (typeInfo)\r
349                         {\r
350                             BaseHandle baseHandle = typeInfo.CreateInstance();\r
351                             if (baseHandle)\r
352                             {\r
353                                 Popup toast = Popup.DownCast(baseHandle);\r
354                                 TextLabel text = new TextLabel("This is a Toast.\nIt will auto-hide itself");\r
355                                 text.TextColor = Color.White;\r
356                                 text.MultiLine = true;\r
357                                 text.HorizontalAlignment = "center";\r
358                                 toast.SetTitle(text);\r
359                                 _stage.GetDefaultLayer().Add(toast);\r
360                                 toast.SetDisplayState(Popup.DisplayStateType.Shown);\r
361                             }\r
362                         }\r
363                         return true;\r
364                     };\r
365                     _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
366                 }\r
367                 if (item.name.CompareTo("ItemView") == 0)\r
368                 {\r
369 \r
370                 }\r
371             }\r
372             else\r
373             {\r
374                 ImageView notSupportView = new ImageView("/home/owner/apps_rw/NUISamples.TizenTV/res/images/not_yet_sign.png");\r
375                 notSupportView.Size = new Size(_stage.Size.Width * 0.2f, _stage.Size.Height * 0.25f, 0.0f);\r
376                 notSupportView.Focusable = true;\r
377                 _contentContainer.AddChild(notSupportView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
378             }\r
379         }\r
380         Popup CreatePopup()\r
381         {\r
382             Popup confirmationPopup = new Popup();\r
383 \r
384             Actor footer = new Actor();\r
385             footer.Name = "Footer";\r
386             footer.WidthResizePolicy = ResizePolicyType.FillToParent;\r
387             footer.HeightResizePolicy = ResizePolicyType.Fixed;\r
388             footer.Size = new Size(0.0f, 80.0f, 0.0f);\r
389             footer.ParentOrigin = ParentOrigin.Center;\r
390             footer.AnchorPoint = AnchorPoint.Center;\r
391 \r
392             PushButton okButton = CreateOKButton();\r
393             okButton.ParentOrigin = ParentOrigin.Center;\r
394             okButton.AnchorPoint = AnchorPoint.Center;\r
395             okButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;\r
396             okButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;\r
397             okButton.SizeModeFactor = new Vector3(-20.0f, -20.0f, 0.0f);\r
398 \r
399             PushButton cancelButton = CreateCancelButton();\r
400             cancelButton.ParentOrigin = ParentOrigin.Center;\r
401             cancelButton.AnchorPoint = AnchorPoint.Center;\r
402             cancelButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;\r
403             cancelButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;\r
404             cancelButton.SizeModeFactor = new Vector3(-20.0f, -20.0f, 0.0f);\r
405 \r
406             TableView controlLayout = new TableView(1, 2);\r
407             controlLayout.ParentOrigin = ParentOrigin.Center;\r
408             controlLayout.AnchorPoint = AnchorPoint.Center;\r
409             controlLayout.WidthResizePolicy = ResizePolicyType.FillToParent;\r
410             controlLayout.HeightResizePolicy = ResizePolicyType.FillToParent;\r
411             controlLayout.SetCellPadding(new Size2D(10.0f, 10.0f));\r
412             controlLayout.SetRelativeWidth(0, 0.5f);\r
413             controlLayout.SetRelativeWidth(1, 0.5f);\r
414             controlLayout.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);\r
415             controlLayout.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);\r
416             controlLayout.AddChild(okButton, new TableView.CellPosition(0, 0));\r
417             controlLayout.AddChild(cancelButton, new TableView.CellPosition(0, 1));\r
418 \r
419             footer.Add(controlLayout);\r
420 \r
421             confirmationPopup.SetFooter(footer);\r
422             return confirmationPopup;\r
423         }\r
424         Actor CreateTitle(string title)\r
425         {\r
426             TextLabel titleActor = new TextLabel(title);\r
427             titleActor.TextColor = Color.White;\r
428             titleActor.MultiLine = true;\r
429             titleActor.HorizontalAlignment = "center";\r
430             return titleActor;\r
431         }\r
432 \r
433         PushButton CreateOKButton()\r
434         {\r
435             PushButton okayButton = new PushButton();\r
436             okayButton.Name = "OKButton";\r
437             okayButton.LabelText = "OK";\r
438             okayButton.Focusable = true;\r
439             okayButton.Clicked += (obj, ee) =>\r
440             {\r
441                 _popup.SetDisplayState(Popup.DisplayStateType.Hidden);\r
442                 return true;\r
443             };\r
444             return okayButton;\r
445         }\r
446         PushButton CreateCancelButton()\r
447         {\r
448             PushButton cancelButton = new PushButton();\r
449             cancelButton.LabelText = "Cancel";\r
450             cancelButton.Focusable = true;\r
451             cancelButton.Clicked += (obj, ee) =>\r
452             {\r
453                 _popup.SetDisplayState(Popup.DisplayStateType.Hidden);\r
454                 return true;\r
455             };\r
456             return cancelButton;\r
457         }\r
458 \r
459         public void MainLoop()\r
460         {\r
461             _application.MainLoop();\r
462         }\r
463 \r
464         /// <summary>\r
465         /// The main entry point for the application.\r
466         /// </summary>\r
467 \r
468         [STAThread]\r
469         static void Main(string[] args)\r
470         {\r
471             Tizen.Log.Debug("NUI", "dali c# control-dashboard! main() is called!");\r
472 \r
473             Example example = new Example(Application.NewApplication("/home/owner/apps_rw/NUISamples.TizenTV/res/json/control-dashboard-theme.json"));\r
474             example.MainLoop();\r
475         }\r
476     }\r
477 }\r