예제 #1
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            ListViewControl.AddHandler(PointerPressedEvent, PointerPressedHandler, true);
            CoreWindow.GetForCurrentThread().KeyDown += RecycleBin_KeyDown;
            SelectionExtention = new ListViewBaseSelectionExtention(ListViewControl, DrawRectangle);

            await ActivateLoading(true, Globalization.GetString("Progress_Tip_Loading"));

            using (FullTrustProcessController.ExclusiveUsage Exclusive = await FullTrustProcessController.GetAvailableController())
            {
                IReadOnlyList <IRecycleStorageItem> Result = await Exclusive.Controller.GetRecycleBinItemsAsync();

                FileCollection.AddRange(SortCollectionGenerator.GetSortedCollection(Result, SortTarget.Name, SortDirection.Ascending));
            }

            if (FileCollection.Count == 0)
            {
                HasFile.Visibility        = Visibility.Visible;
                ClearRecycleBin.IsEnabled = false;
            }
            else
            {
                HasFile.Visibility        = Visibility.Collapsed;
                ClearRecycleBin.IsEnabled = true;
            }

            await ActivateLoading(false);
        }
예제 #2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            ListViewControl.AddHandler(PointerPressedEvent, PointerPressedHandler, true);
            CoreWindow.GetForCurrentThread().KeyDown += RecycleBin_KeyDown;
            SelectionExtention = new ListViewBaseSelectionExtention(ListViewControl, DrawRectangle);

            using (FullTrustProcessController.ExclusiveUsage Exclusive = await FullTrustProcessController.GetAvailableController())
            {
                List <IRecycleStorageItem> Result = await Exclusive.Controller.GetRecycleBinItemsAsync().ConfigureAwait(true);

                foreach (IRecycleStorageItem Item in SortCollectionGenerator.Current.GetSortedCollection(Result, SortTarget.Name, SortDirection.Ascending))
                {
                    FileCollection.Add(Item);
                }
            }

            if (FileCollection.Count == 0)
            {
                HasFile.Visibility        = Visibility.Visible;
                ClearRecycleBin.IsEnabled = false;
            }
            else
            {
                HasFile.Visibility        = Visibility.Collapsed;
                ClearRecycleBin.IsEnabled = true;
            }
        }
예제 #3
0
 private void RecycleBin_Loaded(object sender, RoutedEventArgs e)
 {
     ListViewControl.AddHandler(PointerPressedEvent, PointerPressedHandler, true);
     CoreWindow.GetForCurrentThread().KeyDown += RecycleBin_KeyDown;
     SelectionExtention = new ListViewBaseSelectionExtention(ListViewControl, DrawRectangle);
 }