首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

wpf – ListView更迭背景色

2013-07-08 
wpf – ListView交替背景色?在ListView上使用该styleAnd you will need to apply that style on the ListVi

wpf – ListView交替背景色

?在ListView上使用该style

And you will need to apply that style on the ListView.

    public class MainWindowViewModel    {        #region Fields         private List<Customer> _customers;        #endregion Fields          #region Contructors        public MainWindowViewModel()        {            Initialize();        }        #endregion Constructors         #region Methods        public void Initialize()        {            _customers = new List<Customer>()                             {                                 new Customer()                                     {                                       Name  = "Joe",                                       Address = "Hanhua",                                       Age = 12,                                     },                                  new Customer()                                     {                                       Name  = "Nora",                                       Address = "Hanhua",                                       Age = 32,                                     },                                  new Customer()                                     {                                       Name  = "Karl",                                       Address = "Huaihai",                                       Age = 12,                                     },                                 new Customer()                                     {                                       Name  = "Summer",                                       Address = "Huaihai",                                       Age = 24,                                     },                             };        }        #endregion Methods          public CollectionView Customers        {            get { return new CollectionView(_customers); }        } 

?

References:

How to : Alternate the Background Color for rows in a ListView.?http://msdn.microsoft.com/en-us/library/ms750769(v=vs.85).aspx

?

热点排行