/// <summary> /// Set the options on the popup /// </summary> /// <param name="update">Update to apply on the options</param> /// <returns></returns> /// <exception cref="ComponentNotAddedToMapException">The control has not been added to the map</exception> /// <exception cref="PopupAlreadyRemovedException">The popup has already been removed</exception> public virtual async ValueTask SetOptionsAsync(Action <PopupOptions> update) { Logger?.LogAzureMapsControlInfo(AzureMapLogEvent.Popup_SetOptionsAsync, "Poup - SetOptionsAsync"); EnsureJsRuntimeExists(); EnsureNotRemoved(); if (Options is null) { Options = new PopupOptions(); } update.Invoke(Options); Logger?.LogAzureMapsControlDebug(AzureMapLogEvent.Popup_SetOptionsAsync, $"Id: {Id}"); await JSRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Popup.SetOptions.ToPopupNamespace(), Id, Options); }
/// <summary> /// Apply a template on a popup /// </summary> /// <param name="template">Template to apply</param> /// <param name="properties">Properties of the template</param> /// <param name="update">Update to apply on the options</param> /// <returns></returns> /// <exception cref="ComponentNotAddedToMapException">The control has not been added to the map</exception> /// <exception cref="PopupAlreadyRemovedException">The popup has already been removed</exception> public async ValueTask ApplyTemplateAsync(PopupTemplate template, IDictionary <string, object> properties, Action <PopupOptions> update = null) { Logger?.LogAzureMapsControlInfo(AzureMapLogEvent.Popup_ApplyTemplateAsync, "Poup - ApplyTemplateAsync"); Require.NotNull(properties, nameof(properties)); EnsureJsRuntimeExists(); EnsureNotRemoved(); if (Options is null) { Options = new PopupOptions(); } update?.Invoke(Options); Logger?.LogAzureMapsControlDebug(AzureMapLogEvent.Popup_ApplyTemplateAsync, $"Id: {Id}"); Logger?.LogAzureMapsControlDebug(AzureMapLogEvent.Popup_ApplyTemplateAsync, $"Template: {template}"); Logger?.LogAzureMapsControlDebug(AzureMapLogEvent.Popup_ApplyTemplateAsync, $"Properties: {string.Join('|', properties.Select(kvp => kvp.Key + " : " + kvp.Value))}"); await JSRuntime.InvokeVoidAsync(Constants.JsConstants.Methods.Popup.ApplyTemplate.ToPopupNamespace(), Id, Options, properties, template); }
public Popup(string id, PopupOptions options, PopupEventActivationFlags eventActivationFlags) { Id = string.IsNullOrWhiteSpace(id) ? Guid.NewGuid().ToString() : id; Options = options; EventActivationFlags = eventActivationFlags; }
public Popup(string id, PopupOptions options) : this(id, options, PopupEventActivationFlags.None()) { }
public Popup(PopupOptions options, PopupEventActivationFlags eventActivationFlags) : this(Guid.NewGuid().ToString(), options, eventActivationFlags) { }
public Popup(PopupOptions options) : this(Guid.NewGuid().ToString(), options) { }
public HtmlMarkerPopup(string id, PopupOptions options, PopupEventActivationFlags eventActivationFlags) : base(id, options, eventActivationFlags) { }
public HtmlMarkerPopup(string id, PopupOptions options) : base(id, options) { }
public HtmlMarkerPopup(PopupOptions options, PopupEventActivationFlags eventActivationFlags) : base(options, eventActivationFlags) { }
public HtmlMarkerPopup(PopupOptions options) : base(options) { }