示例#1
0
        /// <summary>
        /// Call this function when you are ready to load the preview and details.
        /// Override if you need custom loading code.
        /// </summary>
        /// <returns>The task to run</returns>
        public virtual async Task LoadAsync()
        {
            var detailsFull = new List <FileProperty>();

            Item.ItemFile ??= await StorageFile.GetFileFromPathAsync(Item.ItemPath);

            DetailsFromPreview = await LoadPreviewAndDetails();

            var props = await GetSystemFileProperties();

            // Add the details from the preview function, then the system file properties
            DetailsFromPreview?.ForEach(i => detailsFull.Add(i));
            props?.ForEach(i => detailsFull.Add(i));

            Item.FileDetails = new System.Collections.ObjectModel.ObservableCollection <FileProperty>(detailsFull);
        }
示例#2
0
        public virtual async Task LoadAsync()
        {
            // Files can be corrupt, in use, and stuff
            try
            {
                var detailsFull = new List <FileProperty>();
                Item.ItemFile ??= await StorageFile.GetFileFromPathAsync(Item.ItemPath);

                DetailsFromPreview = await LoadPreviewAndDetails();

                RaiseLoadedEvent();
                var props = await GetSystemFileProperties();

                DetailsFromPreview?.ForEach(i => detailsFull.Add(i));
                props?.ForEach(i => detailsFull.Add(i));

                Item.FileDetails = new System.Collections.ObjectModel.ObservableCollection <FileProperty>(detailsFull);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
            }
        }