// Show data on page. private void ShowData(KbListInfo listInfo, ObservableCollection<ItemViewModel> Items) { Items.Clear(); foreach (KbListContentInfo contentInfo in listInfo.Contents) { ItemViewModel ivm = new ItemViewModel(); ivm.FileName = contentInfo.FullPath.Substring(contentInfo.FullPath.LastIndexOf("/") + 1); ivm.FileInfo = contentInfo.ModificationDate.ToString(); if (!contentInfo.IsFolder) { ivm.FileInfo = FileUtil.ConvertBytesToKMGB(contentInfo.FileSize) + " " + ivm.FileInfo; } ivm.FileIcon = getFileIcon(contentInfo); ivm.ContentInfo = contentInfo; Items.Add(ivm); } this.IsDataLoaded = true; }
public void LoadRecentViewedFiles() { KbListInfo mockListInfo = new KbListInfo(); mockListInfo.Contents.AddRange(recentViewedFiles); ShowData(mockListInfo, RecentItems); }