3

I'm using a dictionary to populate the list contents using the user details from my login page.

However I need to create a separate source page for every list item.

At the moment the page loads a static source page, is there anyway I can set this dynamically i.e. a source page per created list link?

Alternatively if I can get the name of the current selected task from the list it would be awesome.

Here's a link to the project folder

Image of list page (Each list link has the same source page)

public void PopulateList()
    {
        List<Dictionary<string, string>> tasks = dbConnect.Select("Tasks", "OwnerID = " + userID + "", "task_name, risk_percentage", "ID");

        foreach (Dictionary<string, string> task in tasks)
        {
            Link taskItem = new Link();
            //Task_Page taskPage = new Task_Page();

            Uri taskPageURL = new Uri("Pages/Task Page.xaml", UriKind.Relative);
            taskItem.Source = taskPageURL;
            taskItem.DisplayName = task["task_name"] + " " + task["risk_percentage"] + "%";
            listItems_list.Links.Add(taskItem);
        }
    }
Dan
  • 31
  • 3

1 Answers1

0

You need to bind the ModernWindow.MenuLinkGroups to a collection that you will fill with your links. The collection will be a LinkGroupCollection that will contain LinkGroups and each LinkGroup.Links is a list of Link.

Huseyin Yagli
  • 9,896
  • 6
  • 41
  • 50