using PDF_Master.Model.CloudDrive; using Prism.Commands; using Prism.Mvvm; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PDF_Master.ViewModels.HomePanel.CloudDrive { public class CloudDriveContentViewModel : BindableBase { public DelegateCommand CheckDriveCommand { get; set; } public DelegateCommand CheckDriveLoginUserCommand { get; set; } private CloudDriveManager Manager =>CloudDriveManager.CloudManager; public event EventHandler IshowContentHandler; public CloudDriveContentViewModel() { CheckDriveCommand = new DelegateCommand(CheckDrive); CheckDriveLoginUserCommand = new DelegateCommand(CheckDriveLoginUser); } public void LoadUsers() { var result = Manager.LoadedUsers(); IshowContentHandler?.Invoke(null, !result); } public async void CheckDrive(CloudBoxItem cloudDriveItem) { bool result = false; result = await Manager.LoginUser(cloudDriveItem.CloudDiskType); IshowContentHandler?.Invoke(null, !result); } public async void CheckDriveLoginUser(CloudBoxItem cloudDriveItem) { bool result = false; result = await Manager.LoginUser(cloudDriveItem.CloudDiskType); } } }