简体   繁体   中英

unable to display data from list

for some reason it isnt displaying the dates anything wrong with it?

IsolatedStorageSettings uc = IsolatedStorageSettings.ApplicationSettings;

public void load()
        {
            List<DateTime> List = new List<DateTime>();
            Schedule.ItemsSource = null;
            List<s> medicationList = (List<s>)uc["nList"];

            foreach(sn temp in List)
            {
                if (dateList.Contains(t.Date))
                {

                }
                else
                {                    
                    date.Add(t.Date);
                    Schedule.ItemsSource = List;
                }
            }
        }

Stupid mistake (Solution)

<ListBox x:Name="Schedule" >
</ListBox>

The those and remove unnecessary codes

As a start, move lstboxSchedule.ItemsSource = dateList; outside the foreach.

Set breakpoints to see if/why the list produced is empty.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM