Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5907 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
3 changed files with 35 additions and 1 deletions
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Martin Konicek" email="martin.konicek@gmail.com"/>
|
||||
// <version>$Revision: $</version>
|
||||
// </file>
|
||||
using System; |
||||
using System.Globalization; |
||||
using System.Windows; |
||||
using System.Windows.Data; |
||||
|
||||
namespace ICSharpCode.AvalonEdit.AddIn |
||||
{ |
||||
[ValueConversion(typeof(string), typeof(Visibility))] |
||||
public class StringToVisibilityConverter : IValueConverter |
||||
{ |
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) |
||||
{ |
||||
if (!(value is string)) |
||||
return value == null ? Visibility.Collapsed : Visibility.Visible; |
||||
return string.IsNullOrEmpty((string)value) ? Visibility.Collapsed : Visibility.Visible; |
||||
} |
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) |
||||
{ |
||||
return null; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue