Added UI elements borrowed from DarthAffe

Added a WIP of profile classes
This commit is contained in:
SpoinkyNL committed 2018-01-13 00:06:28 +01:00
1 parent 4f146865a4
commit 6eefa733b4
23 files changed
+847 -108

No files matched your search

@@ -0,0 +1,31 @@
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
namespace Artemis.UI.Converters
{
/// <inheritdoc />
/// <summary>
/// Converts <see cref="T:RGB.NET.Core.Color" /> into <see cref="T:System.Windows.Media.SolidColorBrush" />.
/// </summary>
[ValueConversion(typeof(RGB.NET.Core.Color), typeof(SolidColorBrush))]
public class ColorToSolidColorBrushConverter : IValueConverter
{
/// <inheritdoc />
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return new SolidColorBrush(!(value is RGB.NET.Core.Color color)
? Color.FromArgb(0, 0, 0, 0)
: Color.FromArgb(color.A, color.R, color.G, color.B));
}
/// <inheritdoc />
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return !(value is SolidColorBrush brush)
? RGB.NET.Core.Color.Transparent
: new RGB.NET.Core.Color(brush.Color.A, brush.Color.R, brush.Color.G, brush.Color.B);
}
}
}