Hello there, I have a question about the MainLayout.razor of Northwind demo app,
I try to implemented the Header and SlideBar of the Main Layout like this demo
But when I click on RadzenSidebarToggle, seems the Header and the SlideBar was not hide/show correctly. Can you help me check my fault and show me the correct code for that. Thank you.
The my demo project as this link: https://drive.google.com/file/d/17hVw6DWGZJVxan_SMWGIYnEdAwNok-Xn/view?usp=sharing
The MainLayout.razor file : https://drive.google.com/open?id=13hh1J7OVkCiD6qIB4_bhr-8PIuVKi4C5
@inherits LayoutComponentBase
<RadzenHeader Style="margin-left: 250px;">
<ChildContent>
<div class="row justify-content-start align-items-center">
<div class="col-md-6 d-flex align-items-center">
<RadzenSidebarToggle Click="@SidebarToggle0Click">
</RadzenSidebarToggle>
<RadzenLabel Text="Test">
</RadzenLabel>
</div>
<div class="col-md-6 text-lg-right">
</div>
</div>
</ChildContent>
</RadzenHeader>
<RadzenBody @ref="body0">
<ChildContent>
<RadzenContentContainer Name="main">
@Body
</RadzenContentContainer>
</ChildContent>
</RadzenBody>
<RadzenSidebar @ref="sidebar0" Style="top: 0px; bottom: 0px; transform: translateX(0px);">
<ChildContent>
<RadzenImage Path="https://demos.radzen.com/assets/images/radzen-logo-white.svg" Style="margin: 20px; width: 200px;">
</RadzenImage>
<RadzenPanelMenu>
<ChildContent>
<RadzenPanelMenuItem Text="First Look" Path="/" Icon="home"></RadzenPanelMenuItem>
<RadzenPanelMenuItem Text="DataGrid" Path="datagrid" Icon="grid_on"></RadzenPanelMenuItem>
</ChildContent>
</RadzenPanelMenu>
</ChildContent>
</RadzenSidebar>
<RadzenFooter>
<ChildContent>
<RadzenLabel Text="Test, Copyright © 2019">
</RadzenLabel>
</ChildContent>
</RadzenFooter>
@code{
protected RadzenBody body0;
protected RadzenSidebar sidebar0;
protected async void SidebarToggle0Click(dynamic args)
{
sidebar0.Toggle();
body0.Toggle();
}
}
Many thanks.