manual nui merge 0.2.38
[platform/core/csapi/nui.git] / NUISamples / NUISamples / NUISamples.TizenTV / examples / control-dashboard.cs
old mode 100755 (executable)
new mode 100644 (file)
similarity index 60%
rename from examples/control-dashboard.cs
rename to NUISamples/NUISamples/NUISamples.TizenTV/examples/control-dashboard.cs
index abe7efa..5a20333
@@ -1,26 +1,30 @@
-/** Copyright (c) 2017 Samsung Electronics Co., Ltd.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 using System;
 using System.Runtime.InteropServices;
-using Dali;
+using Tizen.NUI;
+using Tizen.NUI.UIComponents;
+using Tizen.NUI.BaseComponents;
+using Tizen.NUI.Constants;
 
-namespace MyCSharpExample
+namespace ControlDashboard
 {
-    class Example
+    class Example : NUIApplication
     {
         // This is simple structure to contain Control name and implement state at once
         // name : control name
@@ -37,12 +41,12 @@ namespace MyCSharpExample
             }
         }
 
-        private Dali.Application _application;
         private TableView _contentContainer;
         private Timer _timer;
         private Window _window;
         private Popup _popup;
         private ProgressBar _progressBar;
+        private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res";
 
         // List of items
         private Item[] mViewList = {
@@ -53,39 +57,52 @@ namespace MyCSharpExample
       new Item("ItemView", false),    new Item("CheckBox", true)
     };
 
-        public Example(Dali.Application application)
+        public Example() : base()
         {
-            _application = application;
-            _application.Initialized += OnInitialize;
         }
 
-        public void OnInitialize(object source, NUIApplicationInitEventArgs e)
+        public Example(string stylesheet) : base(stylesheet)
         {
-            Console.WriteLine("Customized Application Initialize event handler");
+        }
+
+        public Example(string stylesheet, NUIApplication.WindowMode windowMode) : base(stylesheet, windowMode)
+        {
+        }
+
+        protected override void OnCreate()
+        {
+            base.OnCreate();
+            Initialize();
+        }
+
+        public void Initialize()
+        {
+            Tizen.Log.Debug("NUI", "Customized Application Initialize event handler");
             _window = Window.Instance;
             _window.BackgroundColor = Color.White;
 
             // Top label
             TextLabel topLabel = new TextLabel();
-            topLabel.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-            topLabel.SetResizePolicy(ResizePolicyType.SIZE_RELATIVE_TO_PARENT, DimensionType.HEIGHT);
-            topLabel.AnchorPoint = NDalic.AnchorPointTopCenter;
-            topLabel.Position = new Position(0, 0, 0);
+            topLabel.WidthResizePolicy = ResizePolicyType.FillToParent;
+            topLabel.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;
+            topLabel.AnchorPoint = AnchorPoint.TopCenter;
             topLabel.SetSizeModeFactor(new Vector3(0.0f, 0.1f, 0.0f));
             topLabel.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f);
-            topLabel.TextColor = NDalic.WHITE;
+            topLabel.TextColor = Color.White;
             topLabel.Text = " DALi Views";
-            topLabel.HorizontalAlignment = "BEGIN";
-            topLabel.VerticalAlignment = "CENTER";
+            topLabel.HorizontalAlignment = HorizontalAlignment.Begin;
+            topLabel.VerticalAlignment = VerticalAlignment.Center;
             topLabel.PointSize = 42.0f;
-            _window.Add(topLabel);
+            _window.GetDefaultLayer().Add(topLabel);
+            //StyleManager.Get().ApplyStyle(topLabel, _resPath + "/json/control-dashboard-theme.json", "TextFieldFontSize4");
+            topLabel.SetStyleName("TextFieldFontSize4");
 
             // Grid container to contain items. Use tableView because FlexContainer support focus navigation just two direction ( up/down or left/right )
             _contentContainer = new TableView(6, 5);
-            _contentContainer.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-            _contentContainer.SetResizePolicy(ResizePolicyType.SIZE_RELATIVE_TO_PARENT, DimensionType.HEIGHT);
+            _contentContainer.WidthResizePolicy = ResizePolicyType.FillToParent;
+            _contentContainer.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;
             _contentContainer.SetSizeModeFactor(new Vector3(0.0f, 0.9f, 0.0f));
-            _contentContainer.AnchorPoint = NDalic.AnchorPointBottomCenter;
+            _contentContainer.AnchorPoint = AnchorPoint.BottomCenter;
             _contentContainer.Position = new Position(0, _window.Size.Height * 0.1f, 0);
             _contentContainer.SetRelativeHeight(0, 0.07f);
             _contentContainer.SetRelativeHeight(1, 0.26f);
@@ -93,8 +110,8 @@ namespace MyCSharpExample
             _contentContainer.SetRelativeHeight(3, 0.26f);
             _contentContainer.SetRelativeHeight(4, 0.07f);
             _contentContainer.SetRelativeHeight(5, 0.26f);
-            _contentContainer.SetKeyboardFocusable(true);
-            _window.Add(_contentContainer);
+            _contentContainer.Focusable = (true);
+            _window.GetDefaultLayer().Add(_contentContainer);
 
             CreateContent();
 
@@ -104,11 +121,11 @@ namespace MyCSharpExample
         // Callback for KeyboardFocusManager
         private View OnPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e)
         {
-            if (!e.Proposed && !e.Current)
+            if (!e.ProposedView && !e.CurrentView)
             {
-                e.Proposed = _contentContainer.GetChildAt(1);
+                e.ProposedView = View.DownCast(_contentContainer.GetChildAt(1));
             }
-            return e.Proposed;
+            return e.ProposedView;
         }
 
         private void CreateContent()
@@ -123,10 +140,10 @@ namespace MyCSharpExample
         {
             // Make label for item
             TextLabel itemLabel = new TextLabel("    " + item.name);
-            itemLabel.Size = new Vector3(_window.GetSize().Width * 0.2f, _window.GetSize().Height * 0.05f, 0.0f);
-            itemLabel.HorizontalAlignment = "BEGIN";
-            itemLabel.VerticalAlignment = "BOTTOM";
-            itemLabel.PointSize = 18.0f;
+            itemLabel.Size = new Vector3(_window.Size.Width * 0.2f, _window.Size.Height * 0.05f, 0.0f);
+            itemLabel.HorizontalAlignment = HorizontalAlignment.Begin;
+            itemLabel.VerticalAlignment = VerticalAlignment.Bottom;
+            //itemLabel.PointSize = 18.0f;
             _contentContainer.AddChild(itemLabel, new TableView.CellPosition(((uint)idx / 5) * 2, (uint)idx % 5));
 
             // If item is implemented in public, attach it on window
@@ -136,14 +153,15 @@ namespace MyCSharpExample
                 {
                     PushButton pushButton = new PushButton();
                     pushButton.LabelText = "Push Button";
-                    pushButton.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-                    pushButton.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
+                    pushButton.WidthResizePolicy = ResizePolicyType.FillToParent;
+                    pushButton.HeightResizePolicy = ResizePolicyType.FillToParent;
                     pushButton.UnselectedColor = new Vector4(1.0f, 0.0f, 0.0f, 1.0f);
                     pushButton.SelectedColor = new Vector4(0.0f, 1.0f, 0.0f, 1.0f);
                     pushButton.Clicked += (obj, e) =>
                     {
-                        e.Button.LabelText = "Click Me";
-                        e.Button.UnselectedColor = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
+                        Button sender = obj as Button;
+                        sender.LabelText = "Click Me";
+                        sender.UnselectedColor = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
                         return true;
                     };
 
@@ -156,23 +174,23 @@ namespace MyCSharpExample
                 if (item.name.CompareTo("Toggle") == 0)
                 {
                     ToggleButton toggleButton = new ToggleButton();
-                    Dali.Property.Array array = new Dali.Property.Array();
-                    array.Add(new Dali.Property.Value("./images/star-highlight.png"));
-                    array.Add(new Dali.Property.Value("./images/star-mod.png"));
-                    array.Add(new Dali.Property.Value("./images/star-dim.png"));
+                    PropertyArray array = new PropertyArray();
+                    array.Add(new PropertyValue(_resPath + "/images/star-highlight.png"));
+                    array.Add(new PropertyValue(_resPath + "/images/star-mod.png"));
+                    array.Add(new PropertyValue(_resPath + "/images/star-dim.png"));
                     toggleButton.StateVisuals = array;
 
-                    Dali.Property.Array tooltips = new Dali.Property.Array();
-                    tooltips.Add(new Dali.Property.Value("State A"));
-                    tooltips.Add(new Dali.Property.Value("State B"));
-                    tooltips.Add(new Dali.Property.Value("State C"));
+                    PropertyArray tooltips = new PropertyArray();
+                    tooltips.Add(new PropertyValue("State A"));
+                    tooltips.Add(new PropertyValue("State B"));
+                    tooltips.Add(new PropertyValue("State C"));
                     toggleButton.Tooltips = tooltips;
 
-                    toggleButton.WidthResizePolicy = "FILL_TO_PARENT";
-                    toggleButton.HeightResizePolicy = "FILL_TO_PARENT";
+                    toggleButton.WidthResizePolicy = ResizePolicyType.FillToParent;
+                    toggleButton.HeightResizePolicy = ResizePolicyType.FillToParent;
                     toggleButton.Clicked += (obj, e) =>
                     {
-                        Console.WriteLine("Toggle button state changed.");
+                        Tizen.Log.Debug("NUI", "Toggle button state changed.");
                         return true;
                     };
 
@@ -193,9 +211,9 @@ namespace MyCSharpExample
                 if (item.name.CompareTo("ProgressBar") == 0)
                 {
                     _progressBar = new ProgressBar();
-                    _progressBar.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-                    _progressBar.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.HEIGHT);
-                    _progressBar.SetSize(0, 50);
+                    _progressBar.WidthResizePolicy = ResizePolicyType.FillToParent;
+                    _progressBar.HeightResizePolicy = ResizePolicyType.Fixed;
+                    _progressBar.Size2D = new Size2D(0, 100);
 
                     _progressBar.ValueChanged += OnProgressBarValueChanged;
 
@@ -234,13 +252,12 @@ namespace MyCSharpExample
                 if (item.name.CompareTo("RadioButton") == 0)
                 {
                     TableView tableView = new TableView(2, 1);
-                    tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-                    tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
+                    tableView.WidthResizePolicy = ResizePolicyType.FillToParent;
+                    tableView.HeightResizePolicy = ResizePolicyType.FillToParent;
 
                     RadioButton rButton = new RadioButton();
                     rButton.LabelText = "Yes";
                     rButton.Selected = true;
-
                     tableView.AddChild(rButton, new TableView.CellPosition(0, 0));
 
                     rButton = new RadioButton();
@@ -253,44 +270,43 @@ namespace MyCSharpExample
                 if (item.name.CompareTo("Tooltip") == 0)
                 {
                     TableView tableView = new TableView(2, 1);
-                    tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-                    tableView.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.HEIGHT);
+                    tableView.WidthResizePolicy = ResizePolicyType.FillToParent;
+                    tableView.HeightResizePolicy = ResizePolicyType.FillToParent;
 
                     // Create two push buttons and add them to a table view
                     PushButton buttonWithSimpleTooltip = new PushButton();
                     buttonWithSimpleTooltip.LabelText = "Tooltip with text only";
                     buttonWithSimpleTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f);
                     buttonWithSimpleTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f);
-                    buttonWithSimpleTooltip.WidthResizePolicy = "FILL_TO_PARENT";
+                    buttonWithSimpleTooltip.WidthResizePolicy = ResizePolicyType.FillToParent;
                     tableView.AddChild(buttonWithSimpleTooltip, new TableView.CellPosition(0, 0));
 
                     PushButton buttonWithIconTooltip = new PushButton();
                     buttonWithIconTooltip.LabelText = "Tooltip with Text and Icon";
-                    buttonWithIconTooltip.WidthResizePolicy = "FILL_TO_PARENT";
+                    buttonWithIconTooltip.WidthResizePolicy = ResizePolicyType.FillToParent;
                     buttonWithIconTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f);
                     buttonWithIconTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f);
-
                     tableView.AddChild(buttonWithIconTooltip, new TableView.CellPosition(1, 0));
 
                     // Add a simple text only tooltip to the first push button
                     buttonWithSimpleTooltip.TooltipText = "Simple Tooltip";
 
                     // Create a property map for a tooltip with one icon and one text
-                    Property.Array iconTooltipContent = new Property.Array();
+                    PropertyArray iconTooltipContent = new PropertyArray();
 
-                    Property.Map iconVisual = new Property.Map();
-                    iconVisual.Add(Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Image))
-                      .Add(Dali.Constants.ImageVisualProperty.URL, new Property.Value("./images/star-highlight.png"));
-                    iconTooltipContent.Add(new Property.Value(iconVisual));
+                    PropertyMap iconVisual = new PropertyMap();
+                    iconVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image))
+                      .Add(ImageVisualProperty.URL, new PropertyValue(_resPath + "/images/star-highlight.png"));
+                    iconTooltipContent.Add(new PropertyValue(iconVisual));
 
-                    Property.Map textVisual = new Property.Map();
-                    textVisual.Add(Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Text))
-                      .Add(Dali.Constants.TextVisualProperty.Text, new Property.Value("Tooltip with Icon"));
-                    iconTooltipContent.Add(new Property.Value(textVisual));
+                    PropertyMap textVisual = new PropertyMap();
+                    textVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text))
+                      .Add(TextVisualProperty.Text, new PropertyValue("Tooltip with Icon"));
+                    iconTooltipContent.Add(new PropertyValue(textVisual));
 
-                    Property.Map iconTooltip = new Property.Map();
-                    iconTooltip.Add(Dali.Constants.Tooltip.Property.Content, new Property.Value(iconTooltipContent))
-                      .Add(Dali.Constants.Tooltip.Property.Tail, new Property.Value(true));
+                    PropertyMap iconTooltip = new PropertyMap();
+                    iconTooltip.Add(Tizen.NUI.Constants.Tooltip.Property.Content, new PropertyValue(iconTooltipContent))
+                      .Add(Tizen.NUI.Constants.Tooltip.Property.Tail, new PropertyValue(true));
 
                     // Add the tooltip with icon and text to the second push button
                     buttonWithIconTooltip.Tooltip = iconTooltip;
@@ -301,27 +317,26 @@ namespace MyCSharpExample
                 {
                     PushButton button = new PushButton();
                     button.LabelText = "Popup";
-                    button.ParentOrigin = NDalic.ParentOriginCenter;
-                    button.AnchorPoint = NDalic.AnchorPointCenter;
-                    button.MaximumSize = new Vector2(90.0f, 50.0f);
+                    button.AnchorPoint = AnchorPoint.Center;
+                    button.MaximumSize = new Size2D(150, 100);
                     _popup = CreatePopup();
                     _popup.SetTitle(CreateTitle("Popup"));
 
                     TextLabel text = new TextLabel("This will erase the file permanently. Are you sure?");
                     text.BackgroundColor = Color.White;
                     text.MultiLine = true;
-                    text.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-                    text.SetResizePolicy(ResizePolicyType.DIMENSION_DEPENDENCY, DimensionType.HEIGHT);
+                    text.WidthResizePolicy = ResizePolicyType.FillToParent;
+                    text.HeightResizePolicy = ResizePolicyType.DimensionDependency;
                     text.SetPadding(new PaddingType(10.0f, 10.0f, 20.0f, 0.0f));
                     _popup.SetContent(text);
-                    _popup.SetKeyboardFocusable(true);
-                    _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
+                    _popup.Focusable = (true);
+                    _popup.SetDisplayState(Popup.DisplayStateType.Hidden);
 
                     button.Clicked += (obj, ee) =>
                     {
-                        _window.Add(_popup);
-                        _popup.SetDisplayState(Popup.DisplayStateType.SHOWN);
-                        FocusManager.Instance.SetCurrentFocusView((_popup.FindChildByName("Footer")).FindChildByName("OKButton"));
+                        _window.GetDefaultLayer().Add(_popup);
+                        _popup.SetDisplayState(Popup.DisplayStateType.Shown);
+                        FocusManager.Instance.SetCurrentFocusView(View.DownCast((_popup.FindChildByName("Footer")).FindChildByName("OKButton")));
                         return true;
                     };
                     _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
@@ -330,8 +345,7 @@ namespace MyCSharpExample
                 {
                     PushButton button = new PushButton();
                     button.LabelText = "Toast";
-                    button.ParentOrigin = NDalic.ParentOriginCenter;
-                    button.AnchorPoint = NDalic.AnchorPointCenter;
+                    button.AnchorPoint = AnchorPoint.Center;
                     button.Clicked += (obj, ee) =>
                     {
                         TypeInfo typeInfo = new TypeInfo(TypeRegistry.Get().GetTypeInfo("PopupToast"));
@@ -344,10 +358,10 @@ namespace MyCSharpExample
                                 TextLabel text = new TextLabel("This is a Toast.\nIt will auto-hide itself");
                                 text.TextColor = Color.White;
                                 text.MultiLine = true;
-                                text.HorizontalAlignment = "center";
+                                text.HorizontalAlignment = HorizontalAlignment.Center;
                                 toast.SetTitle(text);
-                                _window.Add(toast);
-                                toast.SetDisplayState(Popup.DisplayStateType.SHOWN);
+                                _window.GetDefaultLayer().Add(toast);
+                                toast.SetDisplayState(Popup.DisplayStateType.Shown);
                             }
                         }
                         return true;
@@ -361,10 +375,9 @@ namespace MyCSharpExample
             }
             else
             {
-                ImageView notSupportView = new ImageView("images/not_yet_sign.png");
-                notSupportView.Size = new Vector3(_window.GetSize().Width * 0.2f, _window.GetSize().Height * 0.25f, 0.0f);
-                notSupportView.SetKeyboardFocusable(true);
-
+                ImageView notSupportView = new ImageView(_resPath + "/images/not_yet_sign.png");
+                notSupportView.Size = new Vector3(_window.Size.Width * 0.2f, _window.Size.Height * 0.25f, 0.0f);
+                notSupportView.Focusable = (true);
                 _contentContainer.AddChild(notSupportView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5));
             }
         }
@@ -373,40 +386,36 @@ namespace MyCSharpExample
             Popup confirmationPopup = new Popup();
 
             View footer = new View();
-            footer.SetName("Footer");
-            footer.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.WIDTH);
-            footer.SetResizePolicy(ResizePolicyType.FIXED, DimensionType.HEIGHT);
-            footer.SetSize(0.0f, 80.0f);
-            footer.ParentOrigin = NDalic.ParentOriginCenter;
-            footer.AnchorPoint = NDalic.AnchorPointCenter;
+            footer.Name = ("Footer");
+            footer.WidthResizePolicy = ResizePolicyType.FillToParent;
+            footer.HeightResizePolicy = ResizePolicyType.Fixed;
+            footer.Size = new Size(0.0f, 80.0f, 0.0f);
+            footer.AnchorPoint = AnchorPoint.Center;
 
             PushButton okButton = CreateOKButton();
-            okButton.ParentOrigin = NDalic.ParentOriginCenter;
-            okButton.AnchorPoint = NDalic.AnchorPointCenter;
-            okButton.SetResizePolicy(ResizePolicyType.SIZE_FIXED_OFFSET_FROM_PARENT, DimensionType.ALL_DIMENSIONS);
+            okButton.AnchorPoint = AnchorPoint.Center;
+            okButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
+            okButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
             okButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));
 
-
             PushButton cancelButton = CreateCancelButton();
-            cancelButton.ParentOrigin = NDalic.ParentOriginCenter;
-            cancelButton.AnchorPoint = NDalic.AnchorPointCenter;
-            cancelButton.SetResizePolicy(ResizePolicyType.SIZE_FIXED_OFFSET_FROM_PARENT, DimensionType.ALL_DIMENSIONS);
+            cancelButton.AnchorPoint = AnchorPoint.Center;
+            cancelButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
+            cancelButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
             cancelButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));
 
-
             TableView controlLayout = new TableView(1, 2);
-            controlLayout.ParentOrigin = NDalic.ParentOriginCenter;
-            controlLayout.AnchorPoint = NDalic.AnchorPointCenter;
-            controlLayout.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.ALL_DIMENSIONS);
+            controlLayout.AnchorPoint = AnchorPoint.Center;
+            controlLayout.WidthResizePolicy = ResizePolicyType.FillToParent;
+            controlLayout.HeightResizePolicy = ResizePolicyType.FillToParent;
             controlLayout.SetCellPadding(new Size2D(10, 10));
             controlLayout.SetRelativeWidth(0, 0.5f);
             controlLayout.SetRelativeWidth(1, 0.5f);
-            controlLayout.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.CENTER, VerticalAlignmentType.CENTER);
-            controlLayout.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.CENTER, VerticalAlignmentType.CENTER);
+            controlLayout.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);
+            controlLayout.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.Center, VerticalAlignmentType.Center);
             controlLayout.AddChild(okButton, new TableView.CellPosition(0, 0));
             controlLayout.AddChild(cancelButton, new TableView.CellPosition(0, 1));
 
-
             footer.Add(controlLayout);
 
             confirmationPopup.SetFooter(footer);
@@ -414,23 +423,22 @@ namespace MyCSharpExample
         }
         View CreateTitle(string title)
         {
-            TextLabel titleActor = new TextLabel(title);
-            titleActor.TextColor = Color.White;
-            titleActor.MultiLine = true;
-            titleActor.HorizontalAlignment = "center";
-
-            return titleActor;
+            TextLabel titleView = new TextLabel(title);
+            titleView.TextColor = Color.White;
+            titleView.MultiLine = true;
+            titleView.HorizontalAlignment = HorizontalAlignment.Center;
+            return titleView;
         }
 
         PushButton CreateOKButton()
         {
             PushButton okayButton = new PushButton();
-            okayButton.SetName("OKButton");
+            okayButton.Name = ("OKButton");
             okayButton.LabelText = "OK";
-            okayButton.SetKeyboardFocusable(true);
+            okayButton.Focusable = (true);
             okayButton.Clicked += (obj, ee) =>
             {
-                _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
+                _popup.SetDisplayState(Popup.DisplayStateType.Hidden);
                 return true;
             };
             return okayButton;
@@ -439,10 +447,10 @@ namespace MyCSharpExample
         {
             PushButton cancelButton = new PushButton();
             cancelButton.LabelText = "Cancel";
-            cancelButton.SetKeyboardFocusable(true);
+            cancelButton.Focusable = (true);
             cancelButton.Clicked += (obj, ee) =>
             {
-                _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
+                _popup.SetDisplayState(Popup.DisplayStateType.Hidden);
                 return true;
             };
             return cancelButton;
@@ -450,30 +458,27 @@ namespace MyCSharpExample
 
         void OnProgressBarValueChanged(object source, ProgressBar.ValueChangedEventArgs e)
         {
-            Property.Map labelVisual = new Property.Map();
-            labelVisual.Add(Dali.Constants.Visual.Property.Type, new Property.Value((int)Dali.Constants.Visual.Type.Text))
-              .Add(Dali.Constants.TextVisualProperty.Text, new Property.Value(Math.Round(e.ProgressBar.ProgressValue, 2) + " / " + Math.Round(e.ProgressBar.SecondaryProgressValue, 2)));
+            PropertyMap labelVisual = new PropertyMap();
+            labelVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text))
+              .Add(TextVisualProperty.Text, new PropertyValue(Math.Round(e.ProgressBar.ProgressValue, 2) + " / " + Math.Round(e.ProgressBar.SecondaryProgressValue, 2)))
+              .Add(TextVisualProperty.PointSize, new PropertyValue(10.0f));
             e.ProgressBar.LabelVisual = labelVisual;
             return;
         }
 
-        public void MainLoop()
-        {
-            _application.MainLoop();
-        }
 
         /// <summary>
         /// The main entry point for the application.
         /// </summary>
 
         [STAThread]
-        static void Main(string[] args)
+        static void _Main(string[] args)
         {
-            Console.WriteLine("Hello Mono World");
+            Tizen.Log.Debug("NUI", "Hello Mono World");
 
-            Example example = new Example(Application.NewApplication("json/control-dashboard.json"));
-            example.MainLoop();
+            Example example = new Example("/home/owner/apps_rw/NUISamples.TizenTV/res/json/control-dashboard-theme.json");
+            
+            example.Run(args);
         }
     }
 }
-