Split device views/VMs for surface and profile editors

Added support for devices without images to the surface editor
This commit is contained in:
SpoinkyNL committed 2019-10-12 18:00:21 +02:00
1 parent a752c75239
commit d9c2e7b2dc
13 files changed
+334 -109

No files matched your search

@@ -0,0 +1,35 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Artemis.UI.Converters
{
public class NullToVisibilityConverter : IValueConverter
{
private enum Parameters
{
Normal,
Inverted
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var direction = (Parameters) Enum.Parse(typeof(Parameters), (string) parameter ?? throw new InvalidOperationException());
if (direction == Parameters.Normal)
{
if (value == null)
return Visibility.Hidden;
return Visibility.Visible;
}
if (value == null)
return Visibility.Visible;
return Visibility.Hidden;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}