Use Interop

This commit is contained in:
hishamco
2020-12-02 02:10:01 +03:00
parent 75556070d6
commit 330499dda5
5 changed files with 42 additions and 11 deletions

View File

@ -1,4 +1,4 @@
using Microsoft.JSInterop;
using Microsoft.JSInterop;
using Oqtane.Models;
using System.Threading.Tasks;
@ -234,5 +234,32 @@ namespace Oqtane.UI
}
}
public async Task<string> getCulture()
{
try
{
var culture = await _jsRuntime.InvokeAsync<string>("Oqtane.Interop.getCulture");
return culture;
}
catch
{
return null;
}
}
public Task setCulture(string culture)
{
try
{
_jsRuntime.InvokeVoidAsync("Oqtane.Interop.setCulture", culture);
return Task.CompletedTask;
}
catch
{
return Task.CompletedTask;
}
}
}
}