mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Split device views/VMs for surface and profile editors
Added support for devices without images to the surface editor
This commit is contained in:
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user