示例#1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var np = e.Parameter as Views.Properties.PropertyNavParam;

            AppInstance = np.AppInstanceArgument;
            ViewModel   = new SelectedItemsPropertiesViewModel(AppInstance.SlimContentPage);

            if (np.navParameter is LibraryItem library)
            {
                BaseProperties = new LibraryProperties(ViewModel, np.tokenSource, Dispatcher, library, AppInstance);
            }
            else if (np.navParameter is ListedItem item)
            {
                if (item.PrimaryItemAttribute == StorageItemTypes.File)
                {
                    BaseProperties = new FileProperties(ViewModel, np.tokenSource, Dispatcher, hashProgress, item, AppInstance);
                }
                else if (item.PrimaryItemAttribute == StorageItemTypes.Folder)
                {
                    BaseProperties = new FolderProperties(ViewModel, np.tokenSource, Dispatcher, item, AppInstance);
                }
            }
            else if (np.navParameter is List <ListedItem> items)
            {
                BaseProperties = new CombinedProperties(ViewModel, np.tokenSource, Dispatcher, items, AppInstance);
            }
            else if (np.navParameter is DriveItem drive)
            {
                BaseProperties = new DriveProperties(ViewModel, drive, AppInstance);
            }

            base.OnNavigatedTo(e);
        }
示例#2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            var np = e.Parameter as Views.Properties.PropertyNavParam;

            AppInstance = np.AppInstanceArgument;
            ViewModel = new SelectedItemsPropertiesViewModel(AppInstance.ContentPage);

            if (np.navParameter is ListedItem)
            {
                var listedItem = np.navParameter as ListedItem;
                if (listedItem.PrimaryItemAttribute == StorageItemTypes.File)
                {
                    BaseProperties = new FileProperties(ViewModel, np.tokenSource, DispatcherQueue, ItemMD5HashProgress, listedItem, AppInstance);
                }
                else if (listedItem.PrimaryItemAttribute == StorageItemTypes.Folder)
                {
                    BaseProperties = new FolderProperties(ViewModel, np.tokenSource, DispatcherQueue, listedItem, AppInstance);
                }
            }
            else if (np.navParameter is List<ListedItem>)
            {
                BaseProperties = new CombinedProperties(ViewModel, np.tokenSource, DispatcherQueue, np.navParameter as List<ListedItem>, AppInstance);
            }
            else if (np.navParameter is DriveItem)
            {
                BaseProperties = new DriveProperties(ViewModel, np.navParameter as DriveItem, AppInstance);
            }

            base.OnNavigatedTo(e);
        }