mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-27 21:27:19 -08:00
26 lines
954 B
C#
26 lines
954 B
C#
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) {
|
|
var mode = (Preference.FilesDisplayMode)value;
|
|
switch (mode) {
|
|
case Preference.FilesDisplayMode.Grid:
|
|
return App.Current.FindResource("Icon.Grid") as Geometry;
|
|
case Preference.FilesDisplayMode.List:
|
|
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();
|
|
}
|
|
}
|
|
}
|