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:
Geoffroy BONNEVILLE
2020-04-17 16:56:07 +02:00
parent 2fb5b14085
commit 73670e8689
73 changed files with 131 additions and 1872 deletions

View File

@@ -0,0 +1,28 @@
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace ModernKeePass.Converters
{
public class BooleanToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, string language)
{
var boolean = value as bool? ?? false;
return boolean ? Visibility.Visible : Visibility.Collapsed;
}
// No need to implement this
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
var visibility = value as Visibility? ?? Visibility.Visible;
switch (visibility)
{
case Visibility.Visible: return true;
case Visibility.Collapsed: return false;
default:
throw new ArgumentOutOfRangeException(nameof(value));
}
}
}
}