public MainFrameViewModel(UserInformation currentUser)
 {
     PathNavigateCommand  = new AsyncCommand(PathNavigate, CanPathNavigate);
     UserInformation      = new UserInformationViewModel(currentUser);
     MainContainerContent = new FileListViewModel();
     //FileList.NavigateByPathAsync("/");
 }
Exemple #2
0
        public FileListItemViewModel(FileListViewModel parent, FileMetaData fileMetaData)
        {
            Parent      = parent;
            Name        = fileMetaData.Name;
            MTime       = Calculators.UnixTimeStampConverter(fileMetaData.Mtime);
            ATime       = Calculators.UnixTimeStampConverter(fileMetaData.Atime);
            CTime       = Calculators.UnixTimeStampConverter(fileMetaData.Ctime);
            Locking     = fileMetaData.Locking;
            Preview     = fileMetaData.Preview;
            Directory   = fileMetaData.Directory;
            Size        = Calculators.SizeCalculator(fileMetaData.Size);
            UUID        = fileMetaData.UUID;
            Mime        = fileMetaData.Mime;
            Path        = fileMetaData.Path;
            PreviewType = fileMetaData.PreviewType;

            CopyCommand     = new DependencyCommand(Copy, AlwaysCan);
            CutCommand      = new DependencyCommand(Cut, AlwaysCan);
            DeleteCommand   = new AsyncCommand(Delete, AlwaysCan);
            RenameCommand   = new DependencyCommand(Rename, AlwaysCan);
            ConfirmCommand  = new AsyncCommand(Confirm, CanConfirm);
            DownloadCommand = new DependencyCommand(Download, CanDownload);
            MoreCommand     = new DependencyCommand(More, AlwaysCan);

            if (Directory)
            {
                Icon = IconDictionary["folder"];
            }
            else
            {
                string eName = System.IO.Path.GetExtension(Name);
                Icon = IconDictionary.ContainsKey(eName) ? IconDictionary[eName] : IconDictionary["default"];
            }
        }
        private async void PathNavigate(object parameter)
        {
            string path = parameter as string;

            if (path == "Recovery")
            {
                RecoveryBoxViewModel x = new RecoveryBoxViewModel();
                x.LazyLoad();
                MainContainerContent = x;
            }
            else
            {
                FileListViewModel x = new FileListViewModel();
                await x.NavigateByPath("/" + path, true);

                MainContainerContent = x;
            }
            OnPropertyChanged("MainContainerContent");
        }
 public static async Task NewTask(FileListViewModel targetList, string path)
 {
     await NewTask(targetList.CurrentPath, path);
 }
Exemple #5
0
 public MainFrameViewModel(UserInformation currentUser)
 {
     PathNavigateCommand  = new DependencyCommand(PathNavigate, DependencyCommand.AlwaysCan);
     UserInformation      = new UserInformationViewModel(currentUser);
     MainContainerContent = new FileListViewModel();
 }