diff --git a/src/Artemis.UI/Converters/LedIdToStringConverter.cs b/src/Artemis.UI/Converters/LedIdToStringConverter.cs new file mode 100644 index 000000000..154ca4bb9 --- /dev/null +++ b/src/Artemis.UI/Converters/LedIdToStringConverter.cs @@ -0,0 +1,29 @@ +using System; +using System.Globalization; +using System.Windows.Data; +using RGB.NET.Core; + +namespace Artemis.UI.Converters +{ + [ValueConversion(typeof(LedId), typeof(string))] + public class LedIdToStringConverter : IValueConverter + { + #region Implementation of IValueConverter + + /// + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return value?.ToString(); + } + + /// + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (Enum.TryParse(typeof(LedId), value?.ToString(), true, out object parsedLedId)) + return parsedLedId; + return LedId.Unknown1; + } + + #endregion + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Converters/UriToFileNameConverter.cs b/src/Artemis.UI/Converters/UriToFileNameConverter.cs index 435c1fec5..1118d3eec 100644 --- a/src/Artemis.UI/Converters/UriToFileNameConverter.cs +++ b/src/Artemis.UI/Converters/UriToFileNameConverter.cs @@ -5,6 +5,7 @@ using System.Windows.Data; namespace Artemis.UI.Converters { + [ValueConversion(typeof(Uri), typeof(string))] public class UriToFileNameConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorView.xaml b/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorView.xaml index b91b42a7f..735390a5d 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorView.xaml +++ b/src/Artemis.UI/Screens/ProfileEditor/ProfileEditorView.xaml @@ -60,21 +60,24 @@ s:View.ActionTarget="{Binding ProfileTreeViewModel}" /> - - + - - - @@ -95,20 +98,20 @@ InputGestureText="Ctrl+V" /> - - - - @@ -121,7 +124,7 @@ Icon="{materialDesign:PackIcon Kind=Layers}" Command="{s:Action OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/guides/user/profiles/layers" /> - @@ -129,7 +132,7 @@ Icon="{materialDesign:PackIcon Kind=Stopwatch}" Command="{s:Action OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/guides/user/profiles/timeline" /> - @@ -138,11 +141,11 @@ Command="{s:Action OpenUrl}" CommandParameter="https://wiki.artemis-rgb.com/guides/user/profiles/scripting" /> - - @@ -152,7 +155,7 @@