mirror of https://github.com/abpframework/abp.git
5 changed files with 42 additions and 4 deletions
@ -0,0 +1,9 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Components.WebAssembly |
||||
|
{ |
||||
|
public interface IUiMessageService |
||||
|
{ |
||||
|
Task<bool> ConfirmAsync(string message, string title = null); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,22 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.JSInterop; |
||||
|
using Volo.Abp.DependencyInjection; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Components.WebAssembly |
||||
|
{ |
||||
|
public class UiMessageService : IUiMessageService, ITransientDependency |
||||
|
{ |
||||
|
protected IJSRuntime JsRuntime { get; } |
||||
|
|
||||
|
public UiMessageService(IJSRuntime jsRuntime) |
||||
|
{ |
||||
|
JsRuntime = jsRuntime; |
||||
|
} |
||||
|
|
||||
|
public async Task<bool> ConfirmAsync(string message, string title = null) |
||||
|
{ |
||||
|
//TODO: Implement with sweetalert in a new package
|
||||
|
return await JsRuntime.InvokeAsync<bool>("confirm", message); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue