CloudFilesContent.xaml.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using PDF_Office.Model.CloudDrive;
  2. using PDF_Office.ViewModels.HomePanel.CloudDrive;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace PDF_Office.Views.HomePanel.CloudDrive
  18. {
  19. /// <summary>
  20. /// CloudFilesContent.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class CloudFilesContent : UserControl
  23. {
  24. private List<string> list = new List<string>();
  25. // private GoogleDriveViewModel GoogleDrive = new GoogleDriveViewModel();
  26. private CloudFilesContentViewModel CloudFilesDrive=>DataContext as CloudFilesContentViewModel;
  27. private List<CloudDriveItem> CloudeDrives = new List<CloudDriveItem>();
  28. private CloudType cloudType;
  29. public CloudFilesContent()
  30. {
  31. InitializeComponent();
  32. this.Loaded += usercontrol_Loaded;
  33. }
  34. private void InitCloudDrive()
  35. {
  36. var cloudDriveItem = new CloudDriveItem(CloudType.Box);
  37. CloudeDrives.Add(cloudDriveItem);
  38. cloudDriveItem = new CloudDriveItem(CloudType.DropBox);
  39. CloudeDrives.Add(cloudDriveItem);
  40. cloudDriveItem = new CloudDriveItem(CloudType.GoogleDrive);
  41. CloudeDrives.Add(cloudDriveItem);
  42. cloudDriveItem = new CloudDriveItem(CloudType.OneDrive);
  43. CloudeDrives.Add(cloudDriveItem);
  44. ListFolder.ItemsSource = CloudeDrives;
  45. ListFolder.SelectedIndex = 0;
  46. }
  47. private void usercontrol_Loaded(object sender, RoutedEventArgs e)
  48. {
  49. if(CloudFilesDrive != null)
  50. {
  51. CloudFilesDrive.CheckDriveUsers();
  52. }
  53. }
  54. public void SelectCloudTye(CloudType cloudType)
  55. {
  56. switch (cloudType)
  57. {
  58. case CloudType.GoogleDrive:
  59. cloudType = CloudType.GoogleDrive;
  60. break;
  61. }
  62. }
  63. private void Button_Click(object sender, RoutedEventArgs e)
  64. {
  65. SelectCloudTye(CloudType.GoogleDrive);
  66. }
  67. }
  68. }