ホテル管理システム
ogi
yesterday 1a1c8e71fcd14858f595029f089b2d4a00202b32
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using Microsoft.JSInterop;
using System;
using System.Threading.Tasks;
 
namespace HotelPms.Client.Blazor.Services
{
    public class BrowserResizeService
    {
        public static event Func<Task> OnResize;
 
        [JSInvokable]
        public static async Task OnBrowserResize()
        {
            //if (OnResize == null) { return; }
            await OnResize?.Invoke();
        }
 
        public static async ValueTask<int> GetInnerHeight(IJSRuntime JSRuntime)
        {
            return await JSRuntime.InvokeAsync<int>("browserResize.getInnerHeight");
        }
 
        public static async ValueTask<int> GetInnerWidth(IJSRuntime JSRuntime)
        {
            return await JSRuntime.InvokeAsync<int>("browserResize.getInnerWidth");
        }
    }
}