C#Observable collection by嵌套集合

时间:2017-03-03 13:22:39

标签: c# collections observablecollection

以下是我的模型类

public class TechnicianCalendar : INPCBase
{
    #region members

    private int _avgTravelMph; // Average Travel MPH
    private string _startZipCd; // Starting zip code
    private string _workCenterZipCd; // Work center zip code
    private long _defaultWorkAreaId; // Default work area ID`enter code here`
    private long _orgId; // Organization id
    private string _cntrlCtrName; // Control center name
    private long _calendarId; // Calendar ID
    private bool _transmitFlag; // Transmit Flag
    private Dictionary<List<string>, List<string>> _techttandKeys;
    private ObservableCollection<TechnicianPendingJobs> pjobs;
    private ObservableCollection<TechnicianDay> days;
    private SortedList<DateTime, TechnicianDay> slDays;
    private ObservableCollection<TechnicianListOfTerritories> technicianTerr;

}

以下是我需要对数据进行分组的Sub Modal类

 public class TechnicianListOfTerritories : INPCBase
    {
        private Dictionary<string, string> _listOfTechTerritoriesandKeys;
        public Dictionary<string, string> ListOfTechTerritoriesandKeys
        {
            get
            {
                return _listOfTechTerritoriesandKeys;
            }
            set
            {
                _listOfTechTerritoriesandKeys = value;
            }
        }
    }

现在我有这个模型类的集合

我需要将数据分组到ObservableCollection technicianTerr;

我尝试了下面的一个但不再填充相同的数据

    var test = this.Technicians.GroupBy(ter => ter.TechnicianTerr) 

0 个答案:

没有答案