-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/jspuij/Cortex.Net
- Loading branch information
Showing
10 changed files
with
91 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,54 @@ | ||
@page "/" | ||
@using Cortex.Net.Api | ||
@using Cortex.Net.Blazor | ||
@using Cortex.Net.BlazorTodo.Stores | ||
@implements IDisposable | ||
|
||
@page "/" | ||
|
||
@attribute [Observer] | ||
|
||
@inject ViewStore ViewStore | ||
@inject NavigationManager NavigationManager | ||
|
||
<TodoOverview /> | ||
|
||
@code | ||
{ | ||
/// <summary> | ||
/// Bind to the Navigation changed event. This is necessary because of the Anchor Urls in the TodoMVC sample. | ||
/// </summary> | ||
protected override void OnInitialized() | ||
{ | ||
NavigationManager.LocationChanged += OnLocationChanged; | ||
} | ||
|
||
/// <summary> | ||
/// Handle the OnLocationChanged event. | ||
/// </summary> | ||
/// <param name="sender"></param> | ||
/// <param name="eventArgs"></param> | ||
[Action] | ||
void OnLocationChanged(object sender, LocationChangedEventArgs eventArgs) | ||
{ | ||
switch (NavigationManager.ToBaseRelativePath(eventArgs.Location)) | ||
{ | ||
case "#/active": | ||
this.ViewStore.TodoFilter = TodoFilter.Active; | ||
break; | ||
case "#/completed": | ||
this.ViewStore.TodoFilter = TodoFilter.Completed; | ||
break; | ||
case "#/": | ||
this.ViewStore.TodoFilter = TodoFilter.All; | ||
break; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Release the eventhandler from the Navigation manager. | ||
/// </summary> | ||
public virtual void Dispose() | ||
{ | ||
NavigationManager.LocationChanged -= OnLocationChanged; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters