Exemplo n.º 1
0
        private void FillData(System.Collections.ObjectModel.ObservableCollection <LeaveInfo> observableCollection)
        {
            List <LeaveInfo> leaveInfos = (List <LeaveInfo>)observableCollection.ToList <LeaveInfo>();

            source.Clear();
            for (int i = 0; i < leaveInfos.Count; i++)
            {
                LeaveInfo li   = (LeaveInfo)leaveInfos[i];
                LeaveItem item = new LeaveItem(li);
                item.Submitter = li.Submitter.FirstName + " " + li.Submitter.LastName;
                //item.Index = (i + 1);
                source.Add(item);
            }

            records.ItemsSource = null;
            records.ItemsSource = source;

            int selectIndex = -1;

            for (int i = 0; i < source.Count; i++)
            {
                if (source[i].LeaveInfo.PKLeaveInfoID == currentGUID)
                {
                    selectIndex = i;
                }
            }

            records.SelectedIndex = selectIndex;

            ClientInstance.HideSpinner();
        }