其它地方代码我注释了,只需要一个绑定部分
private void BindGrid()
{
var songs = MediaLibrary.Load();
var view = new PagedCollectionView(songs);
using (view.DeferRefresh())
{
view.GroupDescriptions.Clear();
view.GroupDescriptions.Add(new PropertyGroupDescription("Artist"));
view.GroupDescriptions.Add(new PropertyGroupDescription("Album"));
}
var fg = _flexiTunes;
//fg.CellFactory = new MusicCellFactory();
fg.MergeManager = null; // << review this, should not merge cells with content
//fg.Columns["Duration"].ValueConverter = new SongDurationConverter();
//fg.Columns["Size"].ValueConverter = new SongSizeConverter();
fg.ItemsSource = view;
// configure search box
//_srchTunes.View = view;
//foreach (string name in "Artist|Album|Name".Split('|'))
//{
// _srchTunes.FilterProperties.Add(typeof(Song).GetProperty(name));
//}
//// customize group header content (used by the default CellFactory)
//fg.GroupHeaderConverter = new GroupHeaderConverter();
//// show media library summary (using Linq)
//view.CollectionChanged += songs_CollectionChanged;
//UpdateSongStatus();
}