2020-11-29 06:39:44 -08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
|
|
|
|
namespace SourceGit.Converters {
|
|
|
|
|
|
|
|
|
|
public class FilesDisplayModeToIcon : IValueConverter {
|
|
|
|
|
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
|
2020-12-16 19:55:06 -08:00
|
|
|
|
var mode = (Preference.FilesDisplayMode)value;
|
2020-11-29 06:39:44 -08:00
|
|
|
|
switch (mode) {
|
2020-12-16 19:55:06 -08:00
|
|
|
|
case Preference.FilesDisplayMode.Grid:
|
2020-11-29 06:39:44 -08:00
|
|
|
|
return App.Current.FindResource("Icon.Grid") as Geometry;
|
2020-12-16 19:55:06 -08:00
|
|
|
|
case Preference.FilesDisplayMode.List:
|
2020-11-29 06:39:44 -08:00
|
|
|
|
return App.Current.FindResource("Icon.List") as Geometry;
|
|
|
|
|
default:
|
|
|
|
|
return App.Current.FindResource("Icon.Tree") as Geometry;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|