Skip to content

Commit

Permalink
Up: update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mouadcherkaoui committed Mar 20, 2020
1 parent a937921 commit 6517836
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,28 +75,42 @@ Finally add the ```using``` sections to *_imports.razor*:
@using BxBlazor.Models
```

the next step is to use the UIShell in the main layout, since the components are using Carbon Design System components styles we should respect the layout structure:
the next step is to use the UIShell in the main layout, since the components are using Carbon Design System components styles we should respect the layout structure, also to keep navigation state we will add a component that will hold the UIShell and in it we will add the ```@Body``` fragment to load views a kind of donut disposition:

MainLayout.razor

```html
@inherits LayoutComponentBase

@using BxBlazor.Components.UIShell
<div class="root">
<BxUIShell
HeaderNavLinks="HeaderNavLinks"
HeaderActions="HeaderActions"
SwitcherLinks="SwitcherLinks"
NavSections="Sections"
SideNavFixed="true">
<div class="bx--content">
@Body
</div>
</BxUIShell>
<div id="root">
<ShellLayout>
@Body
</ShellLayout>
</div>
```

ShellLayout.razor

```html
@using BxBlazor.Components.UIShell

<BxUIShell
HeaderNavLinks="HeaderNavLinks"
HeaderActions="HeaderActions"
SwitcherLinks="SwitcherLinks"
NavSections="Sections"
SideNavFixed="true">
<div class="bx--content">
@ChildContent
</div>
</BxUIShell>
```

```cs
@code {
[Parameter]
public RendreFragment ChildContent { get; set; }

IEnumerable<HeaderNavLink> HeaderNavLinks
= new List<HeaderNavLink> {
new HeaderNavLink
Expand Down Expand Up @@ -124,7 +138,7 @@ the next step is to use the UIShell in the main layout, since the components are
}
}
}
};
};

IEnumerable<SwitcherLink> SwitcherLinks;

Expand Down

0 comments on commit 6517836

Please sign in to comment.