|
|
@ -12,29 +12,52 @@ namespace Connected.Components;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class DialogInstance : UIComponent, IDisposable
|
|
|
|
public partial class DialogInstance : UIComponent, IDisposable
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
#region Variables
|
|
|
|
private DialogOptions _options = new();
|
|
|
|
private DialogOptions _options = new();
|
|
|
|
private string _elementId = "dialog_" + Guid.NewGuid().ToString().Substring(0, 8);
|
|
|
|
private string _elementId = "dialog_" + Guid.NewGuid().ToString().Substring(0, 8);
|
|
|
|
private IKeyInterceptor _keyInterceptor;
|
|
|
|
private IKeyInterceptor _keyInterceptor;
|
|
|
|
|
|
|
|
|
|
|
|
[Inject] private IKeyInterceptorFactory _keyInterceptorFactory { get; set; }
|
|
|
|
[Inject] private IKeyInterceptorFactory _keyInterceptorFactory { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[CascadingParameter(Name = "RightToLeft")] public bool RightToLeft { get; set; }
|
|
|
|
|
|
|
|
[CascadingParameter] private DialogProvider Parent { get; set; }
|
|
|
|
[CascadingParameter] private DialogProvider Parent { get; set; }
|
|
|
|
[CascadingParameter] private DialogOptions GlobalDialogOptions { get; set; } = new DialogOptions();
|
|
|
|
[CascadingParameter] private DialogOptions GlobalDialogOptions { get; set; } = new DialogOptions();
|
|
|
|
|
|
|
|
private Dialog _dialog;
|
|
|
|
|
|
|
|
private bool _disposedValue;
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
#region Events
|
|
|
|
[Category(CategoryTypes.Dialog.Misc)] // Behavior and Appearance
|
|
|
|
private void HandleBackgroundClick()
|
|
|
|
public DialogOptions Options
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get
|
|
|
|
if (DisableBackdropClick)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (_dialog?.OnBackdropClick == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (_options == null)
|
|
|
|
Cancel();
|
|
|
|
_options = new DialogOptions();
|
|
|
|
return;
|
|
|
|
return _options;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
set => _options = value;
|
|
|
|
|
|
|
|
|
|
|
|
_dialog?.OnBackdropClick.Invoke();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Cancels all dialogs in dialog provider collection.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public void CancelAll()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Parent?.DismissAll();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Register(Dialog dialog)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (dialog == null)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
_dialog = dialog;
|
|
|
|
|
|
|
|
//AdditionalClassList = dialog.AdditionalClassList;
|
|
|
|
|
|
|
|
TitleContent = dialog.TitleContent;
|
|
|
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Content
|
|
|
|
[Parameter]
|
|
|
|
[Parameter]
|
|
|
|
[Category(CategoryTypes.Dialog.Behavior)]
|
|
|
|
[Category(CategoryTypes.Dialog.Behavior)]
|
|
|
|
public string Title { get; set; }
|
|
|
|
public string Title { get; set; }
|
|
|
@ -46,10 +69,129 @@ public partial class DialogInstance : UIComponent, IDisposable
|
|
|
|
[Parameter]
|
|
|
|
[Parameter]
|
|
|
|
[Category(CategoryTypes.Dialog.Behavior)]
|
|
|
|
[Category(CategoryTypes.Dialog.Behavior)]
|
|
|
|
public RenderFragment Content { get; set; }
|
|
|
|
public RenderFragment Content { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
[Parameter]
|
|
|
|
[Category(CategoryTypes.Dialog.Behavior)]
|
|
|
|
[Category(CategoryTypes.Dialog.Behavior)]
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Styling
|
|
|
|
|
|
|
|
public void ForceRender()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private string SetPosition()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
DialogPosition position;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Options.Position.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
position = Options.Position.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GlobalDialogOptions.Position.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
position = GlobalDialogOptions.Position.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
position = DialogPosition.Center;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return $"dialog-{position.ToDescription()}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetHideHeader()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.NoHeader.HasValue)
|
|
|
|
|
|
|
|
return Options.NoHeader.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.NoHeader.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.NoHeader.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetCloseButton()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.CloseButton.HasValue)
|
|
|
|
|
|
|
|
return Options.CloseButton.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.CloseButton.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.CloseButton.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetDisableBackdropClick()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.DisableBackdropClick.HasValue)
|
|
|
|
|
|
|
|
return Options.DisableBackdropClick.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.DisableBackdropClick.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.DisableBackdropClick.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetCloseOnEscapeKey()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.CloseOnEscapeKey.HasValue)
|
|
|
|
|
|
|
|
return Options.CloseOnEscapeKey.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.CloseOnEscapeKey.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.CloseOnEscapeKey.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private string SetMaxWidth()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MaxWidth maxWidth;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Options.MaxWidth.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
maxWidth = Options.MaxWidth.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GlobalDialogOptions.MaxWidth.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
maxWidth = GlobalDialogOptions.MaxWidth.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
maxWidth = MaxWidth.Small;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return $"dialog-width-{maxWidth.ToDescription()}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetFullWidth()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.FullWidth.HasValue)
|
|
|
|
|
|
|
|
return Options.FullWidth.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.FullWidth.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.FullWidth.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetFulScreen()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.FullScreen.HasValue)
|
|
|
|
|
|
|
|
return Options.FullScreen.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.FullScreen.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.FullScreen.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected string Classname =>
|
|
|
|
|
|
|
|
new CssBuilder("dialog")
|
|
|
|
|
|
|
|
.AddClass(DialogMaxWidth, !FullScreen)
|
|
|
|
|
|
|
|
.AddClass("dialog-width-full", FullWidth && !FullScreen)
|
|
|
|
|
|
|
|
.AddClass("dialog-fullscreen", FullScreen)
|
|
|
|
|
|
|
|
.AddClass("dialog-rtl", RightToLeft)
|
|
|
|
|
|
|
|
.AddClass(_dialog?.AdditionalClassList)
|
|
|
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Custom close icon.
|
|
|
|
/// Custom close icon.
|
|
|
@ -66,35 +208,22 @@ public partial class DialogInstance : UIComponent, IDisposable
|
|
|
|
private bool CloseButton { get; set; }
|
|
|
|
private bool CloseButton { get; set; }
|
|
|
|
private bool FullScreen { get; set; }
|
|
|
|
private bool FullScreen { get; set; }
|
|
|
|
private bool FullWidth { get; set; }
|
|
|
|
private bool FullWidth { get; set; }
|
|
|
|
|
|
|
|
[CascadingParameter(Name = "RightToLeft")] public bool RightToLeft { get; set; }
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
protected override void OnInitialized()
|
|
|
|
[Category(CategoryTypes.Dialog.Misc)] // Behavior and Appearance
|
|
|
|
{
|
|
|
|
public DialogOptions Options
|
|
|
|
ConfigureInstance();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (firstRender)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//Since CloseOnEscapeKey is the only thing to be handled, turn interceptor off
|
|
|
|
|
|
|
|
if (CloseOnEscapeKey)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_keyInterceptor = _keyInterceptorFactory.Create();
|
|
|
|
get
|
|
|
|
|
|
|
|
|
|
|
|
await _keyInterceptor.Connect(_elementId, new KeyInterceptorOptions()
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TargetClass = "dialog",
|
|
|
|
if (_options == null)
|
|
|
|
Keys = {
|
|
|
|
_options = new DialogOptions();
|
|
|
|
new KeyOptions { Key="Escape", SubscribeDown = true },
|
|
|
|
return _options;
|
|
|
|
},
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
_keyInterceptor.KeyDown += HandleKeyDown;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
await base.OnAfterRenderAsync(firstRender);
|
|
|
|
set => _options = value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Behavior
|
|
|
|
internal void HandleKeyDown(KeyboardEventArgs args)
|
|
|
|
internal void HandleKeyDown(KeyboardEventArgs args)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (args.Key)
|
|
|
|
switch (args.Key)
|
|
|
@ -175,157 +304,34 @@ public partial class DialogInstance : UIComponent, IDisposable
|
|
|
|
//AdditionalClassList = Classname;
|
|
|
|
//AdditionalClassList = Classname;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string SetPosition()
|
|
|
|
#endregion
|
|
|
|
{
|
|
|
|
|
|
|
|
DialogPosition position;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Options.Position.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
position = Options.Position.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GlobalDialogOptions.Position.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
position = GlobalDialogOptions.Position.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
position = DialogPosition.Center;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return $"dialog-{position.ToDescription()}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private string SetMaxWidth()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MaxWidth maxWidth;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Options.MaxWidth.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
maxWidth = Options.MaxWidth.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (GlobalDialogOptions.MaxWidth.HasValue)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
maxWidth = GlobalDialogOptions.MaxWidth.Value;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
maxWidth = MaxWidth.Small;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return $"dialog-width-{maxWidth.ToDescription()}";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetFullWidth()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.FullWidth.HasValue)
|
|
|
|
|
|
|
|
return Options.FullWidth.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.FullWidth.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.FullWidth.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetFulScreen()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.FullScreen.HasValue)
|
|
|
|
|
|
|
|
return Options.FullScreen.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.FullScreen.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.FullScreen.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected string Classname =>
|
|
|
|
|
|
|
|
new CssBuilder("dialog")
|
|
|
|
|
|
|
|
.AddClass(DialogMaxWidth, !FullScreen)
|
|
|
|
|
|
|
|
.AddClass("dialog-width-full", FullWidth && !FullScreen)
|
|
|
|
|
|
|
|
.AddClass("dialog-fullscreen", FullScreen)
|
|
|
|
|
|
|
|
.AddClass("dialog-rtl", RightToLeft)
|
|
|
|
|
|
|
|
.AddClass(_dialog?.AdditionalClassList)
|
|
|
|
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetHideHeader()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.NoHeader.HasValue)
|
|
|
|
|
|
|
|
return Options.NoHeader.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.NoHeader.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.NoHeader.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetCloseButton()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Options.CloseButton.HasValue)
|
|
|
|
|
|
|
|
return Options.CloseButton.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.CloseButton.HasValue)
|
|
|
|
#region Lifecycle
|
|
|
|
return GlobalDialogOptions.CloseButton.Value;
|
|
|
|
protected override void OnInitialized()
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetDisableBackdropClick()
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (Options.DisableBackdropClick.HasValue)
|
|
|
|
ConfigureInstance();
|
|
|
|
return Options.DisableBackdropClick.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.DisableBackdropClick.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.DisableBackdropClick.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private bool SetCloseOnEscapeKey()
|
|
|
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (Options.CloseOnEscapeKey.HasValue)
|
|
|
|
if (firstRender)
|
|
|
|
return Options.CloseOnEscapeKey.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (GlobalDialogOptions.CloseOnEscapeKey.HasValue)
|
|
|
|
|
|
|
|
return GlobalDialogOptions.CloseOnEscapeKey.Value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void HandleBackgroundClick()
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (DisableBackdropClick)
|
|
|
|
//Since CloseOnEscapeKey is the only thing to be handled, turn interceptor off
|
|
|
|
return;
|
|
|
|
if (CloseOnEscapeKey)
|
|
|
|
|
|
|
|
|
|
|
|
if (_dialog?.OnBackdropClick == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Cancel();
|
|
|
|
_keyInterceptor = _keyInterceptorFactory.Create();
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_dialog?.OnBackdropClick.Invoke();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Dialog _dialog;
|
|
|
|
|
|
|
|
private bool _disposedValue;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Register(Dialog dialog)
|
|
|
|
await _keyInterceptor.Connect(_elementId, new KeyInterceptorOptions()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (dialog == null)
|
|
|
|
TargetClass = "dialog",
|
|
|
|
return;
|
|
|
|
Keys = {
|
|
|
|
_dialog = dialog;
|
|
|
|
new KeyOptions { Key="Escape", SubscribeDown = true },
|
|
|
|
//AdditionalClassList = dialog.AdditionalClassList;
|
|
|
|
},
|
|
|
|
TitleContent = dialog.TitleContent;
|
|
|
|
});
|
|
|
|
StateHasChanged();
|
|
|
|
_keyInterceptor.KeyDown += HandleKeyDown;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ForceRender()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
StateHasChanged();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
await base.OnAfterRenderAsync(firstRender);
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// Cancels all dialogs in dialog provider collection.
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
public void CancelAll()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Parent?.DismissAll();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
|
@ -350,4 +356,6 @@ public partial class DialogInstance : UIComponent, IDisposable
|
|
|
|
Dispose(disposing: true);
|
|
|
|
Dispose(disposing: true);
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
GC.SuppressFinalize(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|