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

@ -25,13 +25,15 @@
protected override async Task OnParametersSetAsync()
{
_selectedCulture = _selectedCulture = await JSRuntime.InvokeAsync<string>("oqtaneCulture.get");
var interop = new Interop(JSRuntime);
_selectedCulture = await interop.getCulture();
_supportedCultures = await LocalizationService.GetSupportedCultures();
}
private async Task SetCultureAsync(string culture)
{
await JSRuntime.InvokeVoidAsync("oqtaneCulture.set", culture);
var interop = new Interop(JSRuntime);
await interop.setCulture(culture);
NavigationManager.NavigateTo(NavigationManager.Uri, forceLoad: true);
}