I am building a WPF screen with buttons created from an IList in a C# class. It builds and displays the correct number of buttons; but, does not display the text on the buttons that is built from the list items.
I have done this before in another class/screen and it worked fine.
I noticed when debugging that if I hover over the List object in the class that works (BibList), I get the fly-over tip “Inconsistent accessibility: property type ‘System.Collections.Generic.IList’ is less accessible than property ‘BurnIn.UI.Modules.Operations.VieModels.OvenViewModel.BibList’
I don’t get that message in the class that works and it matches what I am seeing (that the XAML can’t see the SlotInfo information); but, everything is public so I don’t see where the accessibility issue is.
Here is the code that declares the list:
namespace BurnIn.UI.Modules.Operations.ViewModels
{
public class SlotInfo
{
public int SlotNumber;
public string BibName;
}
public class OvenViewModel : OvenViewModelBase
{
private List<SlotInfo> m_BibList = new List<SlotInfo>();
public IList<SlotInfo> BibList
{
get { return m_BibList; }
}
The problem was that the SlotInfo elements were members rather than properties. The fly-over “help” tip was a Red Herring.