This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new string has content to bool converter
- Loading branch information
1 parent
8424c0f
commit 7572ad2
Showing
3 changed files
with
24 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// © XIV-Tools. | ||
// Licensed under the MIT license. | ||
|
||
namespace XivToolsWpf.Converters; | ||
|
||
using System; | ||
using System.Windows.Data; | ||
|
||
[ValueConversion(typeof(string), typeof(bool))] | ||
public class StringHasContentToBoolConverter : IValueConverter | ||
{ | ||
public object Convert(object? value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
string? val = value as string; | ||
return !string.IsNullOrEmpty(val); | ||
} | ||
|
||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} |
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