I have created an RTL web app by blazer server side.
my body style default is margin-left:250px and after clicking sidebar this value has been changed to the margin-left:0px;
now I have to change margin-left to margin-right because my app is RTL but I cannot. I implement this code but after the first time, that body receives a style I cannot change.
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (body != null)
{
await InvokeAsync(() => { body.Style = "margin:50px 250px 50px 0 !important"; });
this.StateHasChanged();
}
}
protected async System.Threading.Tasks.Task SidebarToggle0Click(dynamic args)
{
this.SideBarStatus = !this.SideBarStatus;
await InvokeAsync(() => { sidebar.Toggle(); });
if (SideBarStatus)
{
await InvokeAsync(() => { body.Style = "margin:50px 250px 50px 0 !important"; });
}
else
{
await InvokeAsync(() => { body.Style = "margin:50px 0 50px 0 !important"; });
this.StateHasChanged();
}
}