Example #1
0
 private void DescendingSort_Button_Click(object sender, RoutedEventArgs e)
 {
     Files1 = new ObservableCollection <StorageFile>(Files1.OrderByDescending(u => u.Name));
     Files2 = new ObservableCollection <StorageFile>(Files2.OrderByDescending(u => u.Name));
     Files1_ListBox.ItemsSource = Files1;
     Files2_ListBox.ItemsSource = Files2;
 }
Example #2
0
        private async Task ReductFilesAsync()
        {
            Task task = new Task(() =>
            {
                //Skip all that have name eqivalent
                var newFiles1 = Files1.Where(u => !Files2.Any(v => v.Name == u.Name)).ToList();
                var newFiles2 = Files2.Where(u => !Files1.Any(v => v.Name == u.Name)).ToList();

                Files1 = new ObservableCollection <StorageFile>(newFiles1);
                Files2 = new ObservableCollection <StorageFile>(newFiles2);
            });

            task.Start();
            await task;
        }