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)); }
public TutorialModal OnShow(Modal.OnShowHandler onShow) { _modal.OnShow(onShow); return(this); }