示例#1
0
        private void Sort()
        {
            StoresGrouped.Clear();
            var sorted = from store in Stores
                         orderby store.Country, store.City
            group store by store.Country into storeGroup
                select new Grouping <string, Store>(storeGroup.Key, storeGroup);

            StoresGrouped.ReplaceRange(sorted);
        }
示例#2
0
        private void Sort()
        {
            StoresGrouped.Clear();
            var sorted = from store in Stores
                         orderby store.Country, store.City
            group store by store.Country into storeGroup
                select new Grouping <string, Store>(storeGroup.Key, storeGroup);

            foreach (var sort in sorted)
            {
                StoresGrouped.Add(sort);
            }
        }
        private void Sort()
        {
            StoresGrouped.Clear();

            //var sorted = from store in Stores
            //             orderby store.Country, store.City
            //             group store by store.Country into storeGroup
            //             select new Grouping<string, Store>(storeGroup.Key, storeGroup);

            var sorted = from store in Stores
                         orderby store.Name, store.City
            group store by store.Name into storeGroup
                select new Grouping <string, CommonYelpClass>(storeGroup.Key, storeGroup);

            StoresGrouped.ReplaceRange(sorted);
        }