Ejemplo n.º 1
0
        public ProgressModal()
        {
            var x_TODO = Modal();

            x_TODO.Blocking();


            _titleHost    = Raw().WidthStretch();
            _messageHost  = Raw().WidthStretch();
            _footerHost   = Raw().WidthStretch();
            _progressHost = Raw();
            _spinner      = Spinner().Large().Margin(8.px());
            _progressHost.Content(_spinner);
            _progressIndicator = ProgressIndicator();
            _isSpinner         = true;
            _modalHost         = Modal().Blocking().NoLightDismiss().HideCloseButton().CenterContent()
                                 .Content(Stack()
                                          .AlignCenter()
                                          .WidthStretch()
                                          .Children(_titleHost, _progressHost, _messageHost, _footerHost));
        }
Ejemplo n.º 2
0
        public Dialog(IComponent content = null, IComponent title = null, bool centerContent = true)
        {
            _modal = Modal().HideCloseButton().NoLightDismiss().Blocking();

            if (centerContent)
            {
                _modal.CenterContent();
                if (title is TextBlock tb)
                {
                    tb.TextCenter();
                }
            }

            _modal.SetHeader(title);
            _modal.Content = content;
            _modal.StylingContainer.classList.add("tss-dialog");

            _scope = $"dialog-{RNG.Next()}";

            _modal.OnShow(_ => Hotkeys.SetScope(_scope));
            _modal.OnHide(_ => Hotkeys.DeleteScope(_scope));
        }