mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Create a shared project with all Win App common files (8.1 and 10)
Finally use the dependency injected Resource Service
This commit is contained in:
20
WinAppCommon/Converters/EmptyStringToVisibilityConverter.cs
Normal file
20
WinAppCommon/Converters/EmptyStringToVisibilityConverter.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace ModernKeePass.Converters
|
||||
{
|
||||
class EmptyStringToVisibilityConverter: IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
var text = value is string ? value.ToString() : string.Empty;
|
||||
return string.IsNullOrEmpty(text) ? Visibility.Collapsed : Visibility.Visible;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, string language)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user