diff --git a/src/Converters/FilesDisplayModeToIcon.cs b/src/Converters/FilesDisplayModeToIcon.cs new file mode 100644 index 00000000..da5e8b7d --- /dev/null +++ b/src/Converters/FilesDisplayModeToIcon.cs @@ -0,0 +1,26 @@ +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 = (Git.Preference.FilesDisplayMode)value; + switch (mode) { + case Git.Preference.FilesDisplayMode.Grid: + return App.Current.FindResource("Icon.Grid") as Geometry; + case Git.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(); + } + } +} diff --git a/src/Converters/FilesDisplayModeToVisibility.cs b/src/Converters/FilesDisplayModeToVisibility.cs index edcb45ea..3fa7285f 100644 --- a/src/Converters/FilesDisplayModeToVisibility.cs +++ b/src/Converters/FilesDisplayModeToVisibility.cs @@ -2,29 +2,9 @@ using System; using System.Globalization; using System.Windows; 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 = (Git.Preference.FilesDisplayMode)value; - switch (mode) { - case Git.Preference.FilesDisplayMode.Grid: - return App.Current.FindResource("Icon.Grid") as Geometry; - case Git.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(); - } - } - public class FilesDisplayModeToList : IValueConverter { public bool TreatGridAsList { get; set; } = true;