Master Detail - Missing Page List in Release Builds

I've got a master detail page setup. The hamburger menu slides in a list of pages available. Each page opens the same ContentPage but with a different title and ID, which then grabs data from a SQLite DB.

The list is generated in the following manner

using System;
using System.Collections.Generic;

using Xamarin.Forms;

namespace ui.main
{
    public partial class MasterPage : ContentPage
    {
        public sqlite.subscribedTopicsDatabase _topics = new sqlite.subscribedTopicsDatabase();
        public ListView ListView { get { return listView; } }

        public MasterPage()
        {

            InitializeComponent();
            SetupUI();
        }

        /// <summary>
        /// Setups the user interface.
        /// </summary>
        async void SetupUI()
        {

            // Get topics
            var topics = await _topics.GetAllsubscribedTopics();

            var masterPageItems = new List<MasterPageItem>();

            masterPageItems.Add(new MasterPageItem
            {
                Title = "All",
                Topic = -1,
                //IconSource = "contacts.png",
                TargetType = typeof(AllTopicsPage)
            });

            for (int i = 0; i < topics.Count; ++i)
            {
                System.Diagnostics.Debug.WriteLine("I have topic: " + topics[i].name);
                masterPageItems.Add(new MasterPageItem
                {
                    Title = topics[i].name,
                    Topic = topics[i].apiID,
                    TargetType = typeof(TopicDetailPage)
                });
            }

            listView.ItemsSource = masterPageItems;
        }
    }
}

On a debug build, the items appear, on a release build, they do not. See screenshots.

Debug Build
Debug Build

Release Build
Release Build

What could be causing this?

Best Answer

Answers

Sign In or Register to comment.