-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ad6472
commit 92d5f75
Showing
40 changed files
with
329 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
source/FSC_Components/FileListView/Interfaces/ILVItemViewModel.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 70 additions & 42 deletions
112
source/FSC_Components/FolderBrowser/Converters/BoolToVisibilityConverter .cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,82 @@ | ||
namespace FolderBrowser.Converters | ||
{ | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
/// <summary> | ||
/// Converts a boolean value into a configurable | ||
/// value of type <seealso cref="Visibility"/>. | ||
/// | ||
/// Source: http://stackoverflow.com/questions/3128023/wpf-booleantovisibilityconverter-that-converts-to-hidden-instead-of-collapsed-wh | ||
/// </summary> | ||
[ValueConversion(typeof(bool), typeof(Visibility))] | ||
public sealed class BoolToVisibilityConverter : IValueConverter | ||
{ | ||
#region constructor | ||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
|
||
/// <summary> | ||
/// Class constructor | ||
/// Converts a boolean value into a configurable | ||
/// value of type <seealso cref="Visibility"/>. | ||
/// | ||
/// Source: http://stackoverflow.com/questions/3128023/wpf-booleantovisibilityconverter-that-converts-to-hidden-instead-of-collapsed-wh | ||
/// </summary> | ||
public BoolToVisibilityConverter() | ||
[ValueConversion(typeof(bool), typeof(Visibility))] | ||
public sealed class BoolToVisibilityConverter : IValueConverter | ||
{ | ||
// set defaults | ||
TrueValue = Visibility.Visible; | ||
FalseValue = Visibility.Collapsed; | ||
} | ||
#endregion constructor | ||
#region constructor | ||
/// <summary> | ||
/// Class constructor | ||
/// </summary> | ||
public BoolToVisibilityConverter() | ||
{ | ||
// set defaults | ||
TrueValue = Visibility.Visible; | ||
FalseValue = Visibility.Collapsed; | ||
} | ||
#endregion constructor | ||
|
||
#region properties | ||
public Visibility TrueValue { get; set; } | ||
public Visibility FalseValue { get; set; } | ||
#endregion properties | ||
#region properties | ||
/// <summary> | ||
/// Gets/sets the <see cref="Visibility"/> value that is associated | ||
/// (converted into) with the boolean true value. | ||
/// </summary> | ||
public Visibility TrueValue { get; set; } | ||
|
||
#region methods | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (!(value is bool)) | ||
return null; | ||
return (bool)value ? TrueValue : FalseValue; | ||
} | ||
/// <summary> | ||
/// Gets/sets the <see cref="Visibility"/> value that is associated | ||
/// (converted into) with the boolean false value. | ||
/// </summary> | ||
public Visibility FalseValue { get; set; } | ||
#endregion properties | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (Equals(value, TrueValue)) | ||
return true; | ||
#region methods | ||
/// <summary> | ||
/// Convertzs a bool value into <see cref="Visibility"/> as configured in the | ||
/// <see cref="TrueValue"/> and <see cref="FalseValue"/> properties. | ||
/// </summary> | ||
/// <param name="value"></param> | ||
/// <param name="targetType"></param> | ||
/// <param name="parameter"></param> | ||
/// <param name="culture"></param> | ||
/// <returns></returns> | ||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (!(value is bool)) | ||
return null; | ||
|
||
return (bool)value ? TrueValue : FalseValue; | ||
} | ||
|
||
/// <summary> | ||
/// Convertzs a <see cref="Visibility"/> value into bool as configured in the | ||
/// <see cref="TrueValue"/> and <see cref="FalseValue"/> properties. | ||
/// </summary> | ||
/// <param name="value"></param> | ||
/// <param name="targetType"></param> | ||
/// <param name="parameter"></param> | ||
/// <param name="culture"></param> | ||
/// <returns></returns> | ||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (Equals(value, TrueValue)) | ||
return true; | ||
|
||
if (Equals(value, FalseValue)) | ||
return false; | ||
if (Equals(value, FalseValue)) | ||
return false; | ||
|
||
return null; | ||
return null; | ||
} | ||
#endregion methods | ||
} | ||
#endregion methods | ||
} | ||
} |
Oops, something went wrong.