Files
Moonlight/Moonlight.Client/Services/WindowService.cs
2024-10-20 01:05:46 +02:00

19 lines
508 B
C#

using Microsoft.JSInterop;
namespace Moonlight.Client.Services;
public class WindowService
{
private readonly IJSRuntime JsRuntime;
public WindowService(IJSRuntime jsRuntime)
{
JsRuntime = jsRuntime;
}
public async Task Open(string url, string title, int height, int width)
=> await JsRuntime.InvokeVoidAsync("moonlight.window.open", url, title, height, width);
public async Task Close()
=> await JsRuntime.InvokeVoidAsync("moonlight.window.closeCurrent");
}