Beispiel #1
0
        private async void RightPanel_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var listView = sender as ListView;
            if (e.AddedItems.Count == 0)
                return;

            if (listView.SelectionMode == ListViewSelectionMode.Single)
            {
                using (ProgressManager pm = new ProgressManager(MainContent, ProgressLayer, ProgressRingHandler))
                {
                    foreach (File file in e.AddedItems)
                    {
                        if (file.IsDirectory)
                        {
                            await vm.ChangeRightDir(file);
                        }
                        else
                        {
                            await vm.CopyToLeft(file);
                        }
                    }
                }
            }
            else if (listView.SelectionMode == ListViewSelectionMode.Multiple)
            {
                foreach (File file in e.AddedItems)
                {
                    if (file.IsDirectory)
                    {
                        listView.SelectedItems.Remove(file);
                    }
                }
            }
        }
Beispiel #2
0
 private async void AppBarRefreshButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
 {
     int idx = MainContent.SelectedIndex; // 0-left, 1-right
     using (ProgressManager pm = new ProgressManager(MainContent, ProgressLayer, ProgressRingHandler))
     {
         switch (idx)
         {
             case 0:
                 await vm.ChangeLeftDir();
                 break;
             case 1:
                 await vm.ChangeRightDir();
                 break;
         }
     }
 }
Beispiel #3
0
        private async void AppBarCopyButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            int idx = MainContent.SelectedIndex; // 0-left, 1-right

            using (ProgressManager pm = new ProgressManager(MainContent, ProgressLayer, ProgressRingHandler))
            {
                switch (idx)
                {
                    case 0:
                        foreach (File item in LeftPanel.SelectedItems)
                        {
                            await vm.CopyToRigth(item);
                        }
                        break;
                    case 1:
                        foreach (File item in RightPanel.SelectedItems)
                        {
                            await vm.CopyToLeft(item);
                        }
                        break;
                }

                LeftPanel.SelectedItems.Clear();
                RightPanel.SelectedItems.Clear();
                LeftPanel.SelectionMode = ListViewSelectionMode.Single;
                RightPanel.SelectionMode = ListViewSelectionMode.Single;
                AppBarButton_Copy.IsEnabled = false;
            }
        }