예제 #1
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));
        }
예제 #2
0
 public TutorialModal OnHide(Modal.OnHideHandler onHide)
 {
     _modal.OnHide(onHide);
     return(this);
 }