Beispiel #1
0
        public void Activate()
        {
            var window = NUIApplication.GetDefaultWindow();

            oldPageCount = window.GetDefaultNavigator().PageCount;

            var button = new Button()
            {
                Text = "Click to show Dialog",
                WidthResizePolicy  = ResizePolicyType.FillToParent,
                HeightResizePolicy = ResizePolicyType.FillToParent
            };

            button.Clicked += (object sender, ClickedEventArgs e) =>
            {
                var textLabel = new TextLabel("Message")
                {
                    BackgroundColor     = Color.White,
                    Size                = new Size(180, 180),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                };

                DialogPage.ShowDialog(textLabel);
            };

            var page = new ContentPage()
            {
                Content = button,
            };

            window.GetDefaultNavigator().Push(page);
        }
Beispiel #2
0
        public DialogPageContentPage(Window win)
        {
            WidthSpecification  = LayoutParamPolicies.MatchParent;
            HeightSpecification = LayoutParamPolicies.MatchParent;

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

            window       = win;
            oldPageCount = window.GetDefaultNavigator().PageCount;

            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 textLabel = new TextLabel("Message")
                {
                    BackgroundColor     = new Color(0.7f, 0.9f, 0.8f, 1.0f),
                    Size                = new Size(180, 180),
                    HorizontalAlignment = HorizontalAlignment.Center,
                    VerticalAlignment   = VerticalAlignment.Center,
                };

                DialogPage.ShowDialog(textLabel);
            };

            Content = button;
        }
Beispiel #3
0
 private bool RunDialog(DialogPage page)
 {
     return(page.ShowDialog() == DialogResult.OK);
 }