private PopupInfo( IFormCanvas <HTMLElement> canvas, IBareForm <HTMLElement> form, IFormView <HTMLElement> formView) { Canvas = canvas; Form = form; FormView = formView; }
private void TryPutFocusOnForm(IFormCanvas <HTMLElement> frmCnv) { Logger.Debug(GetType(), "TryPutFocusOnForm() frmCnv={0}", frmCnv); Logger.Error(GetType(), "maybe needs to steal focus from glass covered element {0}", Document.ActiveElement); Document.ActiveElement?.Blur(); frmCnv.Focus(); }
public static void RenderAdapter(this IFormCanvas <HTMLElement> self, IView <HTMLElement> form) { Logger.Debug(typeof(FormCanvasExtensions), "RenderAdapter() starting"); self.Body = form.Widget; self.Title = ""; self.UserCancel = null; self.Actions = new List <HTMLElement>(); self.Show(); Logger.Debug(typeof(FormCanvasExtensions), "RenderAdapter() ending"); }
public static void Unrender(this IFormCanvas <HTMLElement> self) { Logger.Debug(typeof(FormCanvasExtensions), "Unrender()"); var handlers = Handlers.Get(self); self.Hide(); if (handlers.OnUserCancel != null) { self.UserCancel = handlers.OnUserCancel; } Handlers.Delete(self); }
public static void RenderForm(this IFormCanvas <HTMLElement> self, IBareForm <HTMLElement> form, Action beforeShow) { Debug($"RenderForm() form into canvas: title={form.Title}, type={form.GetType().FullName}"); var handlers = form.ExternalEventsHandlers; self.UserCancel = handlers.OnUserCancel; self.Body = BuildBody(form.View); self.Actions = form.View.Actions.Select(x => x.Widget); beforeShow(); Handlers.Set(self, handlers); self.Show(); Logger.Debug(typeof(FormCanvasExtensions), "RenderForm() ending"); }
public FormRenderer(IFormCanvas <HTMLElement> masterCanvas, IProvider <IFormCanvas <HTMLElement> > popupCanvasProvider, FormRenderer parentRenderer = null) { _masterCanvas = masterCanvas; if ((popupCanvasProvider == null && parentRenderer == null) || (popupCanvasProvider != null && parentRenderer != null)) { throw new Exception("either has to implement popups itself or delegate to parentRenderer"); } if (popupCanvasProvider != null) { _parent = null; _popups = new PopupImplementation(popupCanvasProvider); } else { _parent = parentRenderer; _popups = null; } }
public static PopupInfo Create( IFormCanvas <HTMLElement> canvas, IBareForm <HTMLElement> form, IFormView <HTMLElement> formView) => new PopupInfo(canvas, form, formView);
public IFormRenderer <HTMLElement> CreateRendererWithBase(IFormCanvas <HTMLElement> masterCanvas) => new FormRenderer(masterCanvas, null, this);
public IFormRenderer <HTMLElement> CreateRendererWithBase(IFormCanvas <HTMLElement> masterCanvas) => _adapted.CreateRendererWithBase(masterCanvas);