Skip to content

Commit

Permalink
#2 #3 #38 Change NavigationState to pass ToDoList for use in page header
Browse files Browse the repository at this point in the history
  • Loading branch information
andylech committed Sep 13, 2020
1 parent b149408 commit 77251ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System;
using ToDoListManager.Data.Responses;
using static ToDoListManager.App;
using static ToDoListManager.Services.Messaging.MessagingService;

Expand All @@ -8,8 +9,7 @@ public class NavigationState
{
#region Constructors

public NavigationState(AppSection appSection,
Guid? listSelected = null)
public NavigationState(AppSection appSection, ToDoList listSelected = null)
{
try
{
Expand All @@ -30,7 +30,7 @@ public class NavigationState
public AppSection AppSectionSelected { get; }

// Identifier for currently selected list (if any)
public Guid? ListSelected { get; }
public ToDoList ListSelected{ get; }

#endregion
}
Expand Down
6 changes: 3 additions & 3 deletions ToDoListManager.Forms/ToDoListManager/Pages/PageTypeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public static string PageTitle(this PageType pageType, NavigationState navState)
// Override page title from PageType to make user-friendly or appropriate
switch (pageType)
{
/* TODO Access page name
case PageType.EditListItems:
pageTitle = < List Name >;
pageTitle = navState.ListSelected?.Name
// NOTE This should only appear during development
?? Strings.EditListItemsPageTitle;

break;
*/
case PageType.EditLists:
pageTitle = Strings.EditListsPageTitle;

Expand Down
2 changes: 2 additions & 0 deletions ToDoListManager.Forms/ToDoListManager/Resources/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ public static class Strings
{
// User-visible page titles

internal const string EditListItemsPageTitle = "Edit list";

internal const string EditListsPageTitle = "Edit lists";
}
}

0 comments on commit 77251ac

Please sign in to comment.