void ComponentDispatcher_LeaveThreadModal(object sender, EventArgs e) { IModalService modalService = Context.Services.GetService <IModalService>(); if (modalService != null) { modalService.SetModalState(false); } }