+ Popup CreatePopup()
+ {
+ Popup confirmationPopup = new Popup();
+
+ Actor footer = new Actor();
+ 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;
+
+ PushButton okButton = CreateOKButton();
+ okButton.ParentOrigin = NDalic.ParentOriginCenter;
+ okButton.AnchorPoint = NDalic.AnchorPointCenter;
+ okButton.SetResizePolicy(ResizePolicyType.SIZE_FIXED_OFFSET_FROM_PARENT, DimensionType.ALL_DIMENSIONS);
+ 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.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.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.AddChild(okButton, new TableView.CellPosition(0, 0));
+ controlLayout.AddChild(cancelButton, new TableView.CellPosition(0, 1));
+
+
+ footer.Add(controlLayout);
+
+ confirmationPopup.SetFooter(footer);
+ return confirmationPopup;
+ }
+ Actor CreateTitle(string title)
+ {
+ TextLabel titleActor = new TextLabel(title);
+ titleActor.TextColor = Color.White;
+ titleActor.MultiLine = true;
+ titleActor.HorizontalAlignment = "center";
+
+ return titleActor;
+ }
+
+ PushButton CreateOKButton()
+ {
+ PushButton okayButton = new PushButton();
+ okayButton.SetName("OKButton");
+ okayButton.LabelText = "OK";
+ okayButton.SetKeyboardFocusable(true);
+ okayButton.Clicked += (obj, ee) =>
+ {
+ _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
+ return true;
+ };
+ return okayButton;
+ }
+ PushButton CreateCancelButton()
+ {
+ PushButton cancelButton = new PushButton();
+ cancelButton.LabelText = "Cancel";
+ cancelButton.SetKeyboardFocusable(true);
+ cancelButton.Clicked += (obj, ee) =>
+ {
+ _popup.SetDisplayState(Popup.DisplayStateType.HIDDEN);
+ return true;
+ };
+ return cancelButton;
+ }
+
+ 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)));
+ e.ProgressBar.LabelVisual = labelVisual;
+ return;
+ }