nui 0.2.32 manual merge, mapping to dali 1.2.32
[platform/core/csapi/tizenfx.git] / NUISample2 / NUISample2 / NUISample2.Tizen / NUISample2.Tizen.cs
1 /*\r
2  * Copyright (c) 2017 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 Tizen.NUI;\r
20 \r
21 namespace ControlDashboard\r
22 {\r
23     class Example : NUIApplication\r
24     {\r
25         // This is simple structure to contain Control name and implement state at once\r
26         // name : control name\r
27         // isImplemented : the state which the control is implemented in public or not\r
28         private struct Item\r
29         {\r
30             public String name;\r
31             public bool isImplemented;\r
32 \r
33             public Item(String name, bool isImplemented)\r
34             {\r
35                 this.name = name;\r
36                 this.isImplemented = isImplemented;\r
37             }\r
38         }\r
39 \r
40         private TableView _contentContainer;\r
41         private Timer _timer;\r
42         private Stage _stage;\r
43         private Popup _popup;\r
44         private ProgressBar _progressBar;\r
45         private const string _resPath = "/home/owner/apps_rw/NUISample2.Tizen/res";\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", true), 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() : base()\r
57         {\r
58         }\r
59 \r
60         public Example(string stylesheet) : base(stylesheet)\r
61         {\r
62         }\r
63 \r
64         public Example(string stylesheet, NUIApplication.WindowMode windowMode) : base(stylesheet, windowMode)\r
65         {\r
66         }\r
67 \r
68         protected override void OnCreate()\r
69         {\r
70             base.OnCreate();\r
71             Initialize();\r
72         }\r
73 \r
74         protected override void OnTerminate()\r
75         {\r
76             base.OnTerminate();\r
77         }\r
78 \r
79         public void Initialize()\r
80         {\r
81             Console.WriteLine("Customized Application Initialize event handler");\r
82             _stage = Stage.Instance;\r
83             _stage.BackgroundColor = Color.White;\r
84             _stage.Key += _stage_Key;\r
85 \r
86             // Top label\r
87             TextLabel topLabel = new TextLabel();\r
88             topLabel.WidthResizePolicy = ResizePolicyType.FillToParent;\r
89             topLabel.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;\r
90             topLabel.AnchorPoint = AnchorPoint.TopCenter;\r
91             topLabel.ParentOrigin = ParentOrigin.TopCenter;\r
92             topLabel.SetSizeModeFactor(new Vector3(0.0f, 0.1f, 0.0f));\r
93             topLabel.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f);\r
94             topLabel.TextColor = Color.White;\r
95             topLabel.Text = " DALi Views";\r
96             topLabel.HorizontalAlignment = "BEGIN";\r
97             topLabel.VerticalAlignment = "CENTER";\r
98             topLabel.PointSize = 42.0f;\r
99             _stage.GetDefaultLayer().Add(topLabel);\r
100             //StyleManager.Get().ApplyStyle(topLabel, _resPath + "/json/control-dashboard-theme.json", "TextFieldFontSize4");\r
101             topLabel.SetStyleName("TextFieldFontSize4");\r
102 \r
103             // Grid container to contain items. Use tableView because FlexContainer support focus navigation just two direction ( up/down or left/right )\r
104             _contentContainer = new TableView(6, 5);\r
105             _contentContainer.WidthResizePolicy = ResizePolicyType.FillToParent;\r
106             _contentContainer.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;\r
107             _contentContainer.SetSizeModeFactor(new Vector3(0.0f, 0.9f, 0.0f));\r
108             _contentContainer.AnchorPoint = AnchorPoint.BottomCenter;\r
109             _contentContainer.ParentOrigin = ParentOrigin.BottomCenter;\r
110             _contentContainer.SetRelativeHeight(0, 0.07f);\r
111             _contentContainer.SetRelativeHeight(1, 0.26f);\r
112             _contentContainer.SetRelativeHeight(2, 0.07f);\r
113             _contentContainer.SetRelativeHeight(3, 0.26f);\r
114             _contentContainer.SetRelativeHeight(4, 0.07f);\r
115             _contentContainer.SetRelativeHeight(5, 0.26f);\r
116             _contentContainer.Focusable = (true);\r
117             _stage.GetDefaultLayer().Add(_contentContainer);\r
118 \r
119             CreateContent();\r
120 \r
121             FocusManager.Instance.PreFocusChange += OnPreFocusChange;\r
122         }\r
123 \r
124         private void _stage_Key(object sender, Stage.KeyEventArgs e)\r
125         {\r
126             if (e.Key.KeyPressedName == "XF86Back")\r
127             {\r
128                 OnTerminate();\r
129             }\r
130         }\r
131 \r
132         // Callback for KeyboardFocusManager\r
133         private View OnPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e)\r
134         {\r
135             if (!e.ProposedView && !e.CurrentView)\r
136             {\r
137                 e.ProposedView = View.DownCast(_contentContainer.GetChildAt(1));\r
138             }\r
139             return e.ProposedView;\r
140         }\r
141 \r
142         private void CreateContent()\r
143         {\r
144             for (int i = 0; i < mViewList.Length; i++)\r
145             {\r
146                 CreateItem(mViewList[i], i);\r
147             }\r
148         }\r
149 \r
150         private void CreateItem(Item item, int idx)\r
151         {\r
152             // Make label for item\r
153             TextLabel itemLabel = new TextLabel("    " + item.name);\r
154             itemLabel.Size = new Vector3(_stage.Size.Width * 0.2f, _stage.Size.Height * 0.05f, 0.0f);\r
155             itemLabel.HorizontalAlignment = "BEGIN";\r
156             itemLabel.VerticalAlignment = "BOTTOM";\r
157             //itemLabel.PointSize = 18.0f;\r
158             _contentContainer.AddChild(itemLabel, new TableView.CellPosition(((uint)idx / 5) * 2, (uint)idx % 5));\r
159 \r
160             // If item is implemented in public, attach it on stage\r
161             if (item.isImplemented)\r
162             {\r
163                 if (item.name.CompareTo("PushButton") == 0)\r
164                 {\r
165                     PushButton pushButton = new PushButton();\r
166                     pushButton.LabelText = "Push Button";\r
167                     pushButton.WidthResizePolicy = ResizePolicyType.FillToParent;\r
168                     pushButton.HeightResizePolicy = ResizePolicyType.FillToParent;\r
169                     pushButton.UnselectedColor = new Vector4(1.0f, 0.0f, 0.0f, 1.0f);\r
170                     pushButton.SelectedColor = new Vector4(0.0f, 1.0f, 0.0f, 1.0f);\r
171                     pushButton.Clicked += (obj, e) =>\r
172                     {\r
173                         Button sender = obj as Button;\r
174                         sender.LabelText = "Click Me";\r
175                         sender.UnselectedColor = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);\r
176                         return true;\r
177                     };\r
178 \r
179                     _contentContainer.AddChild(pushButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
180                 }\r
181                 if (item.name.CompareTo("DropDown") == 0)\r
182                 {\r
183 \r
184                 }\r
185                 if (item.name.CompareTo("Toggle") == 0)\r
186                 {\r
187                     ToggleButton toggleButton = new ToggleButton();\r
188                     PropertyArray array = new PropertyArray();\r
189                     array.Add(new PropertyValue(_resPath + "/images/star-highlight.png"));\r
190                     array.Add(new PropertyValue(_resPath + "/images/star-mod.png"));\r
191                     array.Add(new PropertyValue(_resPath + "/images/star-dim.png"));\r
192                     toggleButton.StateVisuals = array;\r
193 \r
194                     PropertyArray tooltips = new PropertyArray();\r
195                     tooltips.Add(new PropertyValue("State A"));\r
196                     tooltips.Add(new PropertyValue("State B"));\r
197                     tooltips.Add(new PropertyValue("State C"));\r
198                     toggleButton.Tooltips = tooltips;\r
199 \r
200                     toggleButton.WidthResizePolicy = ResizePolicyType.FillToParent;\r
201                     toggleButton.HeightResizePolicy = ResizePolicyType.FillToParent;\r
202                     toggleButton.Clicked += (obj, e) =>\r
203                     {\r
204                         Console.WriteLine("Toggle button state changed.");\r
205                         return true;\r
206                     };\r
207 \r
208                     _contentContainer.AddChild(toggleButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
209                 }\r
210                 if (item.name.CompareTo("InputField") == 0)\r
211                 {\r
212 \r
213                 }\r
214                 if (item.name.CompareTo("AnimateGif") == 0)\r
215                 {\r
216 \r
217                 }\r
218                 if (item.name.CompareTo("Loading") == 0)\r
219                 {\r
220 \r
221                 }\r
222                 if (item.name.CompareTo("ProgressBar") == 0)\r
223                 {\r
224                     _progressBar = new ProgressBar();\r
225                     _progressBar.WidthResizePolicy = ResizePolicyType.FillToParent;\r
226                     _progressBar.HeightResizePolicy = ResizePolicyType.Fixed;\r
227                     _progressBar.Size2D = new Size2D(0, 100);\r
228 \r
229                     _progressBar.ValueChanged += OnProgressBarValueChanged;\r
230 \r
231                     _timer = new Timer(100);\r
232                     _timer.Tick += (obj, e) =>\r
233                     {\r
234                         float progress = (float)Math.Round(_progressBar.ProgressValue, 2);\r
235 \r
236                         if (progress == 1.0f)\r
237                         {\r
238                             _progressBar.ProgressValue = 0.0f;\r
239                             _progressBar.SecondaryProgressValue = 0.01f;\r
240                         }\r
241                         else\r
242                         {\r
243                             _progressBar.ProgressValue = progress + 0.01f;\r
244                             _progressBar.SecondaryProgressValue = progress + 0.21f;\r
245                         }\r
246                         return true;\r
247                     };\r
248                     _timer.Start();\r
249 \r
250                     _contentContainer.AddChild(_progressBar, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
251                 }\r
252                 if (item.name.CompareTo("ScrollBar") == 0)\r
253                 {\r
254 \r
255                 }\r
256                 if (item.name.CompareTo("CheckBox") == 0)\r
257                 {\r
258                     CheckBoxButton checkBoxButton = new CheckBoxButton();\r
259                     checkBoxButton.LabelText = "Yes";\r
260 \r
261                     _contentContainer.AddChild(checkBoxButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
262                 }\r
263                 if (item.name.CompareTo("RadioButton") == 0)\r
264                 {\r
265                     TableView tableView = new TableView(2, 1);\r
266                     tableView.WidthResizePolicy = ResizePolicyType.FillToParent;\r
267                     tableView.HeightResizePolicy = ResizePolicyType.FillToParent;\r
268 \r
269                     RadioButton rButton = new RadioButton();\r
270                     rButton.LabelText = "Yes";\r
271                     rButton.Selected = true;\r
272                     tableView.AddChild(rButton, new TableView.CellPosition(0, 0));\r
273 \r
274                     rButton = new RadioButton();\r
275                     rButton.LabelText = "No";\r
276 \r
277                     tableView.AddChild(rButton, new TableView.CellPosition(1, 0));\r
278 \r
279                     _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
280                 }\r
281                 if (item.name.CompareTo("Tooltip") == 0)\r
282                 {\r
283                     TableView tableView = new TableView(2, 1);\r
284                     tableView.WidthResizePolicy = ResizePolicyType.FillToParent;\r
285                     tableView.HeightResizePolicy = ResizePolicyType.FillToParent;\r
286 \r
287                     // Create two push buttons and add them to a table view\r
288                     PushButton buttonWithSimpleTooltip = new PushButton();\r
289                     buttonWithSimpleTooltip.LabelText = "Tooltip with text only";\r
290                     buttonWithSimpleTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f);\r
291                     buttonWithSimpleTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f);\r
292                     buttonWithSimpleTooltip.WidthResizePolicy = ResizePolicyType.FillToParent;\r
293                     tableView.AddChild(buttonWithSimpleTooltip, new TableView.CellPosition(0, 0));\r
294 \r
295                     PushButton buttonWithIconTooltip = new PushButton();\r
296                     buttonWithIconTooltip.LabelText = "Tooltip with Text and Icon";\r
297                     buttonWithIconTooltip.WidthResizePolicy = ResizePolicyType.FillToParent;\r
298                     buttonWithIconTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f);\r
299                     buttonWithIconTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f);\r
300                     tableView.AddChild(buttonWithIconTooltip, new TableView.CellPosition(1, 0));\r
301 \r
302                     // Add a simple text only tooltip to the first push button\r
303                     buttonWithSimpleTooltip.TooltipText = "Simple Tooltip";\r
304 \r
305                     // Create a property map for a tooltip with one icon and one text\r
306                     PropertyArray iconTooltipContent = new PropertyArray();\r
307 \r
308                     PropertyMap iconVisual = new PropertyMap();\r
309                     iconVisual.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Image))\r
310                       .Add(Tizen.NUI.Constants.ImageVisualProperty.URL, new PropertyValue(_resPath + "/images/star-highlight.png"));\r
311                     iconTooltipContent.Add(new PropertyValue(iconVisual));\r
312 \r
313                     PropertyMap textVisual = new PropertyMap();\r
314                     textVisual.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Text))\r
315                       .Add(Tizen.NUI.Constants.TextVisualProperty.Text, new PropertyValue("Tooltip with Icon"));\r
316                     iconTooltipContent.Add(new PropertyValue(textVisual));\r
317 \r
318                     PropertyMap iconTooltip = new PropertyMap();\r
319                     iconTooltip.Add(Tizen.NUI.Constants.Tooltip.Property.Content, new PropertyValue(iconTooltipContent))\r
320                       .Add(Tizen.NUI.Constants.Tooltip.Property.Tail, new PropertyValue(true));\r
321 \r
322                     // Add the tooltip with icon and text to the second push button\r
323                     buttonWithIconTooltip.Tooltip = iconTooltip;\r
324 \r
325                     _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
326                 }\r
327                 if (item.name.CompareTo("Popup") == 0)\r
328                 {\r
329                     PushButton button = new PushButton();\r
330                     button.LabelText = "Popup";\r
331                     button.ParentOrigin = ParentOrigin.Center;\r
332                     button.AnchorPoint = AnchorPoint.Center;\r
333                     button.MaximumSize = new Size2D(150, 100);\r
334                     _popup = CreatePopup();\r
335                     _popup.SetTitle(CreateTitle("Popup"));\r
336 \r
337                     TextLabel text = new TextLabel("This will erase the file permanently. Are you sure?");\r
338                     text.BackgroundColor = Color.White;\r
339                     text.MultiLine = true;\r
340                     text.WidthResizePolicy = ResizePolicyType.FillToParent;\r
341                     text.HeightResizePolicy = ResizePolicyType.DimensionDependency;\r
342                     text.SetPadding(new PaddingType(10.0f, 10.0f, 20.0f, 0.0f));\r
343                     _popup.SetContent(text);\r
344                     _popup.Focusable = (true);\r
345                     _popup.SetDisplayState(Popup.DisplayStateType.Hidden);\r
346 \r
347                     button.Clicked += (obj, ee) =>\r
348                     {\r
349                         _stage.GetDefaultLayer().Add(_popup);\r
350                         _popup.SetDisplayState(Popup.DisplayStateType.Shown);\r
351                         FocusManager.Instance.SetCurrentFocusView(View.DownCast((_popup.FindChildByName("Footer")).FindChildByName("OKButton")));\r
352                         return true;\r
353                     };\r
354                     _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
355                 }\r
356                 if (item.name.CompareTo("Toast") == 0)\r
357                 {\r
358                     PushButton button = new PushButton();\r
359                     button.LabelText = "Toast";\r
360                     button.ParentOrigin = ParentOrigin.Center;\r
361                     button.AnchorPoint = AnchorPoint.Center;\r
362                     button.Clicked += (obj, ee) =>\r
363                     {\r
364                         TypeInfo typeInfo = new TypeInfo(TypeRegistry.Get().GetTypeInfo("PopupToast"));\r
365                         if (typeInfo)\r
366                         {\r
367                             BaseHandle baseHandle = typeInfo.CreateInstance();\r
368                             if (baseHandle)\r
369                             {\r
370                                 Popup toast = Popup.DownCast(baseHandle);\r
371                                 TextLabel text = new TextLabel("This is a Toast.\nIt will auto-hide itself");\r
372                                 text.TextColor = Color.White;\r
373                                 text.MultiLine = true;\r
374                                 text.HorizontalAlignment = "center";\r
375                                 toast.SetTitle(text);\r
376                                 _stage.GetDefaultLayer().Add(toast);\r
377                                 toast.SetDisplayState(Popup.DisplayStateType.Shown);\r
378                             }\r
379                         }\r
380                         return true;\r
381                     };\r
382                     _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
383                 }\r
384                 if (item.name.CompareTo("ItemView") == 0)\r
385                 {\r
386 \r
387                 }\r
388             }\r
389             else\r
390             {\r
391                 ImageView notSupportView = new ImageView(_resPath + "/images/not_yet_sign.png");\r
392                 notSupportView.Size = new Vector3(_stage.Size.Width * 0.2f, _stage.Size.Height * 0.25f, 0.0f);\r
393                 notSupportView.Focusable = (true);\r
394                 _contentContainer.AddChild(notSupportView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));\r
395             }\r
396         }\r
397         Popup CreatePopup()\r
398         {\r
399             Popup confirmationPopup = new Popup();\r
400 \r
401             Actor footer = new Actor();\r
402             footer.Name = ("Footer");\r
403             footer.WidthResizePolicy = ResizePolicyType.FillToParent;\r
404             footer.HeightResizePolicy = ResizePolicyType.Fixed;\r
405             footer.Size = new Size(0.0f, 80.0f, 0.0f);\r
406             footer.ParentOrigin = ParentOrigin.Center;\r
407             footer.AnchorPoint = AnchorPoint.Center;\r
408 \r
409             PushButton okButton = CreateOKButton();\r
410             okButton.ParentOrigin = ParentOrigin.Center;\r
411             okButton.AnchorPoint = AnchorPoint.Center;\r
412             okButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;\r
413             okButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;\r
414             okButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));\r
415 \r
416             PushButton cancelButton = CreateCancelButton();\r
417             cancelButton.ParentOrigin = ParentOrigin.Center;\r
418             cancelButton.AnchorPoint = AnchorPoint.Center;\r
419             cancelButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;\r
420             cancelButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;\r
421             cancelButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));\r
422 \r
423             TableView controlLayout = new TableView(1, 2);\r
424             controlLayout.ParentOrigin = ParentOrigin.Center;\r
425             controlLayout.AnchorPoint = AnchorPoint.Center;\r
426             controlLayout.WidthResizePolicy = ResizePolicyType.FillToParent;\r
427             controlLayout.HeightResizePolicy = ResizePolicyType.FillToParent;\r
428             controlLayout.SetCellPadding(new Size2D(10, 10));\r
429             controlLayout.SetRelativeWidth(0, 0.5f);\r
430             controlLayout.SetRelativeWidth(1, 0.5f);\r
431             controlLayout.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);\r
432             controlLayout.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);\r
433             controlLayout.AddChild(okButton, new TableView.CellPosition(0, 0));\r
434             controlLayout.AddChild(cancelButton, new TableView.CellPosition(0, 1));\r
435 \r
436             footer.Add(controlLayout);\r
437 \r
438             confirmationPopup.SetFooter(footer);\r
439             return confirmationPopup;\r
440         }\r
441         Actor CreateTitle(string title)\r
442         {\r
443             TextLabel titleActor = new TextLabel(title);\r
444             titleActor.TextColor = Color.White;\r
445             titleActor.MultiLine = true;\r
446             titleActor.HorizontalAlignment = "center";\r
447             return titleActor;\r
448         }\r
449 \r
450         PushButton CreateOKButton()\r
451         {\r
452             PushButton okayButton = new PushButton();\r
453             okayButton.Name = ("OKButton");\r
454             okayButton.LabelText = "OK";\r
455             okayButton.Focusable = (true);\r
456             okayButton.Clicked += (obj, ee) =>\r
457             {\r
458                 _popup.SetDisplayState(Popup.DisplayStateType.Hidden);\r
459                 return true;\r
460             };\r
461             return okayButton;\r
462         }\r
463         PushButton CreateCancelButton()\r
464         {\r
465             PushButton cancelButton = new PushButton();\r
466             cancelButton.LabelText = "Cancel";\r
467             cancelButton.Focusable = (true);\r
468             cancelButton.Clicked += (obj, ee) =>\r
469             {\r
470                 _popup.SetDisplayState(Popup.DisplayStateType.Hidden);\r
471                 return true;\r
472             };\r
473             return cancelButton;\r
474         }\r
475 \r
476         void OnProgressBarValueChanged(object source, ProgressBar.ValueChangedEventArgs e)\r
477         {\r
478             PropertyMap labelVisual = new PropertyMap();\r
479             labelVisual.Add(Tizen.NUI.Constants.Visual.Property.Type, new PropertyValue((int)Tizen.NUI.Constants.Visual.Type.Text))\r
480               .Add(Tizen.NUI.Constants.TextVisualProperty.Text, new PropertyValue(Math.Round(e.ProgressBar.ProgressValue, 2) + " / " + Math.Round(e.ProgressBar.SecondaryProgressValue, 2)))\r
481               .Add(Tizen.NUI.Constants.TextVisualProperty.PointSize, new PropertyValue(10.0f));\r
482             e.ProgressBar.LabelVisual = labelVisual;\r
483             return;\r
484         }\r
485 \r
486 \r
487         /// <summary>\r
488         /// The main entry point for the application.\r
489         /// </summary>\r
490 \r
491         [STAThread]\r
492         static void Main(string[] args)\r
493         {\r
494             Tizen.Log.Debug("NUI", "control-dashboard app Main()");\r
495 \r
496             Example example = new Example("/home/owner/apps_rw/NUISample2.Tizen/res/json/control-dashboard-theme.json");\r
497             example.Run(args);\r
498         }\r
499     }\r
500 }\r