locked
Error_2_Inconsistent accessibility: property type 'System.Collections.ObjectModel.ObservableCollection<XXX.FeedData>' is less accessible than property 'XXX.FeedDataSource.Feeds'_C:\Users\Jonathan\AppData\Local\Temporary Projects\XXX\FeedData.cs_42_47_XXX RRS feed

  • Question

  • Error 2 Inconsistent accessibility: property type 'System.Collections.ObjectModel.ObservableCollection<XXX.FeedData>' is less accessible than property 'XXX.FeedDataSource.Feeds' C:\Users\Jonathan\AppData\Local\Temporary Projects\XXX\FeedData.cs 42 47 XXX

    what problem?

    my code is :

    class FeedData
        {
            public string Title { get; set; }
            public string Description { get; set; }
            public DateTime PubDate { get; set; }
    
            private List<FeedItem> _Items = new List<FeedItem>();
            public List<FeedItem> Items
            {
                get
                {
                    return this._Items;
                }
            }
        }
    
        // FeedItem
        // Holds info for a single blog post
        public class FeedItem
        {
            public string Title { get; set; }
            public string Author { get; set; }
            public string Content { get; set; }
            public DateTime PubDate { get; set; }
            public Uri Link { get; set; }
        }
    
        // FeedDataSource
        // Holds a collection of blog feeds (FeedData), and contains methods needed to
        // retreive the feeds.
        public class FeedDataSource
        {
            private ObservableCollection<FeedData> _Feeds = new ObservableCollection<FeedData>();
            
            public ObservableCollection<FeedData> Feeds <!-- Error Here !-->
            {
                get
                {
                    return this._Feeds;
                }
            }

    Saturday, August 3, 2013 11:16 AM

Answers

  • Try changing class FeedData to public class FeedData.
    • Marked as answer by hang333 Saturday, August 3, 2013 1:12 PM
    Saturday, August 3, 2013 12:24 PM

All replies