object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture) { var size = (long)Convert.ChangeType(value, typeof(long)); var str = FsInfoFormat.FormatFileSize(size); return(str); }
public override void Refresh() { this.DriveInfo = new DriveInfo(Path.GetPathRoot(this.DirInfo.FullName)); this.Icon = FsInfoFormat.GetFsItemIcon(this.DirInfo.FullName, true, out var descr); if (string.IsNullOrWhiteSpace(this.DriveInfo.VolumeLabel)) { this.VolumeDescription = descr; } else { this.VolumeDescription = this.DriveInfo.VolumeLabel + ":" + descr; } this.RaizePropertyChanged("DriveInfo"); this.RaizePropertyChanged("VolumeDescription"); this.RaizePropertyChanged("Icon"); base.Refresh(); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is string filePath && File.Exists(filePath)) { return(FsInfoFormat.GetFsItemIcon(filePath, this.Small, out var descr)); }