How to binddata to a ListBox


need on databinding :

1)note :  pictures collection of picture, picnames collection of names of pictures.

     medialibrary ml = new medialibrary();

            var chkpics = ml.pictures;
            var picnames = p in chkpics
                           p.name.contains("s")
                           select p;

 2) static class


public static class photonames
    {
        private static list<string> m_photoname = new list<string>();

        public static list<string> photofilenames
            {
            get
            {
                return m_photoname;
            }
            set
            {
                m_photoname = value;
            }

        }

 

after getting photo filenames in picnames in way :

 foreach (var pic in picnames)
    {
    
      photonames.photofilenames.add(pic.name);

     }

how bind listbox static class ad show data in textblock inside listbox??

thanks

 

 

 

hi. binding static classes not supported in silverlight. can bind static properties, long class not static. if option you, need declare instance of class in resources somewhere (you can choose declare in central place app.xaml). use instance bind key.

if need static class, think have set binding or items source in code.



Silverlight  >  Silverlight for Windows Phone



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........