Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmendie authored Jan 27, 2024
1 parent ae0a426 commit 7656978
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,42 @@
To begin, install the **Mendi.Blazor.DynamicNavigation** Nuget package from Visual Studio or use the CLI:
`dotnet add package Mendi.Blazor.DynamicNavigation`


## 🔧Configuration

Open your project's **Program.cs** file and replace this section ```await builder.RunAsync()``` with
```csharp
var app = await builder.UseDynamicNavigator();
await app.RunAsync();
```

Now create a `BaseComponent.cs` class in the pages folder or wherever it would be convenient for you. You can change the `BaseComponent.cs` name of course.
You'll have to inherit the `DynamicNavigatorComponentBase` class and add the `NavigatorBaseComponent` attribute. Your class should look similar to this:
```csharp
using Mendi.Blazor.DynamicNavigation;
using Mendi.Blazor.DynamicNavigation.Common;


namespace Test.Pages;
[NavigatorBaseComponent]
public class BaseComponent : DynamicNavigatorComponentBase
{

}
```
The `NavigatorBaseComponent` attribute should be specified on the class acting as your component base class - **Important**
The `NavigatorBaseComponent` attribute should be specified on the class acting as your component base class **This is very important**

Open the `_Imports.razor` file and add the following lines of code
``` csharp
@using Mendi.Blazor.DynamicNavigation
@inherits BaseComponent
```
BaseComponent - This should be the name of your base component class(however you had called it)

After that, add the **BlazorDynamicPageNavigator** component to the Home.razor or Index.razor file `<BlazorDynamicPageNavigator NavigatorContainer="PageRouteContainer" NavigatorRegistry="PageRouteRegistry" />`

## 🚀Using It






Expand Down

0 comments on commit 7656978

Please sign in to comment.