Exemple #1
0
 private void Deactivate()
 {
     if (testDialogPage != null)
     {
         window.GetDefaultNavigator().Pop();
         testDialogPage.Dispose();
         testDialogPage = null;
     }
 }
Exemple #2
0
        public DialogPageContentPage2(Window win)
        {
            WidthSpecification  = LayoutParamPolicies.MatchParent;
            HeightSpecification = LayoutParamPolicies.MatchParent;

            AppBar = new AppBar()
            {
                Title = "Dialog page Sample",
            };

            window = win;

            var button = new Button()
            {
                Text = "Click to show Dialog",
                WidthSpecification     = 400,
                HeightSpecification    = 100,
                ParentOrigin           = Tizen.NUI.ParentOrigin.Center,
                PivotPoint             = Tizen.NUI.PivotPoint.Center,
                PositionUsesPivotPoint = true,
            };

            button.Clicked += (object sender, ClickedEventArgs e) =>
            {
                var dialogPage = new DialogPage()
                {
                    //WidthSpecification = 600,
                    //HeightSpecification = 600,
                    EnableScrim          = true,
                    EnableDismissOnScrim = false,
                    ScrimColor           = Color.Green,
                };

                testDialogPage = dialogPage;

                var textLabel = new TextLabel("Message")
                {
                    BackgroundColor     = Color.White,
                    Size                = new Size(180, 180),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                };

                var positiveButton = new Button()
                {
                    Text = "Yes",
                };
                positiveButton.Clicked += (object s1, ClickedEventArgs e1) =>
                {
                    window.GetDefaultNavigator().Pop();
                    testDialogPage.Dispose();
                    testDialogPage = null;
                };

                var content = new View()
                {
                    WidthSpecification     = 600,
                    HeightSpecification    = 600,
                    ParentOrigin           = Tizen.NUI.ParentOrigin.Center,
                    PivotPoint             = Tizen.NUI.PivotPoint.Center,
                    PositionUsesPivotPoint = true,
                    Layout = new LinearLayout()
                    {
                        LinearOrientation   = LinearLayout.Orientation.Vertical,
                        HorizontalAlignment = HorizontalAlignment.Center,
                        VerticalAlignment   = VerticalAlignment.Center,
                    },
                    BackgroundColor = new Color(0.7f, 0.9f, 0.8f, 1.0f),
                };

                content.Add(textLabel);
                content.Add(positiveButton);

                dialogPage.Content = content;

                NUIApplication.GetDefaultWindow().GetDefaultNavigator().Push(dialogPage);
            };

            Content = button;
        }