diff --git a/src/Artemis.Core/Models/ProfileConfiguration/ConfigurationColorGradientItem.cs b/src/Artemis.Core/Models/ProfileConfiguration/ConfigurationColorGradientItem.cs new file mode 100644 index 000000000..355d04cc8 --- /dev/null +++ b/src/Artemis.Core/Models/ProfileConfiguration/ConfigurationColorGradientItem.cs @@ -0,0 +1,8 @@ +namespace Artemis.Core; + +/// +/// Represents a configuration item that accepts ColorGradient input from the user. +/// +public class ConfigurationColorGradientItem : ConfigurationInputItem +{ +} \ No newline at end of file diff --git a/src/Artemis.Core/Models/ProfileConfiguration/ConfigurationNumericItem.cs b/src/Artemis.Core/Models/ProfileConfiguration/ConfigurationNumericItem.cs index ebfe1a3dd..1f3b166c5 100644 --- a/src/Artemis.Core/Models/ProfileConfiguration/ConfigurationNumericItem.cs +++ b/src/Artemis.Core/Models/ProfileConfiguration/ConfigurationNumericItem.cs @@ -5,4 +5,7 @@ /// public class ConfigurationNumericItem : ConfigurationInputItem { + public Numeric? Minimum { get; set; } + public Numeric? Maximum { get; set; } + public bool Slider { get; set; } } \ No newline at end of file diff --git a/src/Artemis.Core/Models/ProfileConfiguration/ProfileConfiguration.cs b/src/Artemis.Core/Models/ProfileConfiguration/ProfileConfiguration.cs index 5a7cffbec..269eee893 100644 --- a/src/Artemis.Core/Models/ProfileConfiguration/ProfileConfiguration.cs +++ b/src/Artemis.Core/Models/ProfileConfiguration/ProfileConfiguration.cs @@ -308,12 +308,12 @@ public class ProfileConfiguration : BreakableModel, IStorageModel, IDisposable, ConfigurationSections.Add(new ConfigurationSection() { Name = "General (slot 0)", - Slot = 0, + Slot = 2, }); ConfigurationSections.Add(new ConfigurationSection() { Name = "Other (slot 1)", - Slot = 1 + Slot = 2 }); ConfigurationSections.Add(new ConfigurationSection() { @@ -321,11 +321,14 @@ public class ProfileConfiguration : BreakableModel, IStorageModel, IDisposable, Slot = 2 }); ConfigurationSections[0].Items.Add(new ConfigurationTextItem() {Text = "This is a placeholder text item in the General section."}); - ConfigurationSections[0].Items.Add(new ConfigurationNumericItem() {Name = "Numeric item"}); + ConfigurationSections[0].Items.Add(new ConfigurationNumericItem() {Name = "Numeric item", Description = "This one also has a description"}); ConfigurationSections[0].Items.Add(new ConfigurationBooleanItem() {Name = "Do the thing?", TrueText = "Absolutely", FalseText = "Nope"}); ConfigurationSections[1].Items.Add(new ConfigurationTextItem() {Text = "This is a placeholder text item in the Other section."}); ConfigurationSections[2].Items.Add(new ConfigurationTextItem() {Text = "This is a placeholder text item in the Something else section."}); ConfigurationSections[2].Items.Add(new ConfigurationTextItem() {Text = "This is another placeholder text item in the Something else section."}); + ConfigurationSections[2].Items.Add(new ConfigurationNumericItem() {Name = "Numeric item", Description = "This one uses a slider", Minimum = 0, Maximum = 10, Slider = true}); + ConfigurationSections[2].Items.Add(new ConfigurationColorGradientItem() {Name = "Color gradient"}); + ConfigurationSections[2].Items.Add(new ConfigurationSKColorItem() {Name = "A simple color", Description = "Again with a description"}); } /// diff --git a/src/Artemis.Core/Utilities/Numeric.cs b/src/Artemis.Core/Utilities/Numeric.cs index 06c2ca7fd..72e980081 100644 --- a/src/Artemis.Core/Utilities/Numeric.cs +++ b/src/Artemis.Core/Utilities/Numeric.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Globalization; namespace Artemis.Core; @@ -11,7 +12,8 @@ namespace Artemis.Core; /// Usage outside that context is not recommended due to conversion overhead. /// /// -public readonly struct Numeric : IComparable, IConvertible +[TypeConverter(typeof(NumericTypeConverter))] +public readonly struct Numeric : IComparable, IConvertible, IEquatable { private readonly float _value; diff --git a/src/Artemis.Core/Utilities/NumericTypeConverter.cs b/src/Artemis.Core/Utilities/NumericTypeConverter.cs new file mode 100644 index 000000000..61191fb6d --- /dev/null +++ b/src/Artemis.Core/Utilities/NumericTypeConverter.cs @@ -0,0 +1,90 @@ +using System; +using System.ComponentModel; +using System.Globalization; + +namespace Artemis.Core; + +/// +/// Type converter for to support Avalonia binding from other numeric types +/// +public class NumericTypeConverter : TypeConverter +{ + /// + public override bool CanConvertFrom(ITypeDescriptorContext? context, Type sourceType) + { + return sourceType == typeof(double) || + sourceType == typeof(float) || + sourceType == typeof(int) || + sourceType == typeof(long) || + sourceType == typeof(byte) || + sourceType == typeof(short) || + sourceType == typeof(decimal) || + sourceType == typeof(uint) || + sourceType == typeof(ulong) || + sourceType == typeof(ushort) || + sourceType == typeof(sbyte) || + sourceType == typeof(string) || + base.CanConvertFrom(context, sourceType); + } + + /// + public override bool CanConvertTo(ITypeDescriptorContext? context, Type? destinationType) + { + return destinationType == typeof(double) || + destinationType == typeof(float) || + destinationType == typeof(int) || + destinationType == typeof(long) || + destinationType == typeof(byte) || + destinationType == typeof(short) || + destinationType == typeof(decimal) || + destinationType == typeof(uint) || + destinationType == typeof(ulong) || + destinationType == typeof(ushort) || + destinationType == typeof(sbyte) || + destinationType == typeof(string) || + base.CanConvertTo(context, destinationType); + } + + /// + public override object? ConvertFrom(ITypeDescriptorContext? context, CultureInfo? culture, object value) + { + return value switch + { + double d => new Numeric(d), + float f => new Numeric(f), + int i => new Numeric(i), + long l => new Numeric(l), + byte b => new Numeric(b), + short s => new Numeric(s), + decimal dec => new Numeric((double)dec), + uint ui => new Numeric(ui), + ulong ul => new Numeric((long)ul), + ushort us => new Numeric(us), + sbyte sb => new Numeric(sb), + string str => Numeric.TryParse(str, out Numeric result) ? result : throw new FormatException($"Unable to convert '{str}' to Numeric"), + _ => base.ConvertFrom(context, culture, value) + }; + } + + /// + public override object? ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type destinationType) + { + if (value is Numeric numeric) + { + if (destinationType == typeof(double)) return (double)numeric; + if (destinationType == typeof(float)) return (float)numeric; + if (destinationType == typeof(int)) return (int)numeric; + if (destinationType == typeof(long)) return (long)numeric; + if (destinationType == typeof(byte)) return (byte)numeric; + if (destinationType == typeof(short)) return (short)numeric; + if (destinationType == typeof(decimal)) return (decimal)numeric; + if (destinationType == typeof(uint)) return (uint)numeric; + if (destinationType == typeof(ulong)) return (ulong)numeric; + if (destinationType == typeof(ushort)) return (ushort)numeric; + if (destinationType == typeof(sbyte)) return (sbyte)numeric; + if (destinationType == typeof(string)) return numeric.ToString(CultureInfo.InvariantCulture); + } + + return base.ConvertTo(context, culture, value, destinationType); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Preview/PreviewView.axaml b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Preview/PreviewView.axaml index d700793f9..e176d6601 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Preview/PreviewView.axaml +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Preview/PreviewView.axaml @@ -21,51 +21,55 @@ - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationBooleanItemView.axaml b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationBooleanItemView.axaml new file mode 100644 index 000000000..32d5591bf --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationBooleanItemView.axaml @@ -0,0 +1,26 @@ + + + + + + + + + + + diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationBooleanItemView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationBooleanItemView.axaml.cs new file mode 100644 index 000000000..1be1f6c11 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationBooleanItemView.axaml.cs @@ -0,0 +1,14 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using ReactiveUI.Avalonia; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public partial class ConfigurationBooleanItemView : ReactiveUserControl +{ + public ConfigurationBooleanItemView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationBooleanItemViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationBooleanItemViewModel.cs new file mode 100644 index 000000000..92d0ba886 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationBooleanItemViewModel.cs @@ -0,0 +1,14 @@ +using Artemis.Core; +using Artemis.UI.Shared; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public class ConfigurationBooleanItemViewModel : ActivatableViewModelBase +{ + public ConfigurationBooleanItem Item { get; } + + public ConfigurationBooleanItemViewModel(ConfigurationBooleanItem item) + { + Item = item; + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationColorGradientItemView.axaml b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationColorGradientItemView.axaml new file mode 100644 index 000000000..a7f702574 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationColorGradientItemView.axaml @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationColorGradientItemView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationColorGradientItemView.axaml.cs new file mode 100644 index 000000000..027f205e1 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationColorGradientItemView.axaml.cs @@ -0,0 +1,14 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using ReactiveUI.Avalonia; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public partial class ConfigurationColorGradientItemView : ReactiveUserControl +{ + public ConfigurationColorGradientItemView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationColorGradientItemViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationColorGradientItemViewModel.cs new file mode 100644 index 000000000..ee447c530 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationColorGradientItemViewModel.cs @@ -0,0 +1,14 @@ +using Artemis.Core; +using Artemis.UI.Shared; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public class ConfigurationColorGradientItemViewModel : ActivatableViewModelBase +{ + public ConfigurationColorGradientItemViewModel(ConfigurationColorGradientItem item) + { + Item = item; + } + + public ConfigurationColorGradientItem Item { get; } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationNumericItemView.axaml b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationNumericItemView.axaml new file mode 100644 index 000000000..340a6a499 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationNumericItemView.axaml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationNumericItemView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationNumericItemView.axaml.cs new file mode 100644 index 000000000..bafba6c2f --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationNumericItemView.axaml.cs @@ -0,0 +1,14 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using ReactiveUI.Avalonia; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public partial class ConfigurationNumericItemView : ReactiveUserControl +{ + public ConfigurationNumericItemView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationNumericItemViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationNumericItemViewModel.cs new file mode 100644 index 000000000..626b17156 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationNumericItemViewModel.cs @@ -0,0 +1,14 @@ +using Artemis.Core; +using Artemis.UI.Shared; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public class ConfigurationNumericItemViewModel : ActivatableViewModelBase +{ + public ConfigurationNumericItem Item { get; } + + public ConfigurationNumericItemViewModel(ConfigurationNumericItem item) + { + Item = item; + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSKColorItemView.axaml b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSKColorItemView.axaml new file mode 100644 index 000000000..26cfd66f0 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSKColorItemView.axaml @@ -0,0 +1,26 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSKColorItemView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSKColorItemView.axaml.cs new file mode 100644 index 000000000..b1ee507d4 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSKColorItemView.axaml.cs @@ -0,0 +1,14 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using ReactiveUI.Avalonia; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public partial class ConfigurationSKColorItemView : ReactiveUserControl +{ + public ConfigurationSKColorItemView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSKColorItemViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSKColorItemViewModel.cs new file mode 100644 index 000000000..c3f1327ee --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSKColorItemViewModel.cs @@ -0,0 +1,14 @@ +using Artemis.Core; +using Artemis.UI.Shared; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public class ConfigurationSKColorItemViewModel : ActivatableViewModelBase +{ + public ConfigurationSKColorItemViewModel(ConfigurationSKColorItem item) + { + Item = item; + } + + public ConfigurationSKColorItem Item { get; } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSectionView.axaml b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSectionView.axaml index 407fdd53e..9a281578f 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSectionView.axaml +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSectionView.axaml @@ -10,9 +10,25 @@ - - Test - + + + + + + + + + + + + + + + + + diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSectionViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSectionViewModel.cs index 70083013c..086f73175 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSectionViewModel.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationSectionViewModel.cs @@ -1,4 +1,5 @@ -using Artemis.Core; +using System.Collections.ObjectModel; +using Artemis.Core; using Artemis.UI.Shared; namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; @@ -6,9 +7,26 @@ namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; public class ConfigurationSectionViewModel : ActivatableViewModelBase { public ConfigurationSection ConfigurationSection { get; } + public ObservableCollection Items { get; } public ConfigurationSectionViewModel(ConfigurationSection configurationSection) { ConfigurationSection = configurationSection; + Items = []; + foreach (IConfigurationItem item in ConfigurationSection.Items) + { + if (item is ConfigurationTextItem textItem) + Items.Add(new ConfigurationTextItemViewModel(textItem)); + else if (item is ConfigurationStringItem stringItem) + Items.Add(new ConfigurationStringItemViewModel(stringItem)); + else if (item is ConfigurationBooleanItem booleanItem) + Items.Add(new ConfigurationBooleanItemViewModel(booleanItem)); + else if (item is ConfigurationNumericItem numberItem) + Items.Add(new ConfigurationNumericItemViewModel(numberItem)); + else if (item is ConfigurationSKColorItem colorItem) + Items.Add(new ConfigurationSKColorItemViewModel(colorItem)); + else if (item is ConfigurationColorGradientItem colorGradientItem) + Items.Add(new ConfigurationColorGradientItemViewModel(colorGradientItem)); + } } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationStringItemView.axaml b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationStringItemView.axaml new file mode 100644 index 000000000..3996c4400 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationStringItemView.axaml @@ -0,0 +1,21 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationStringItemView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationStringItemView.axaml.cs new file mode 100644 index 000000000..7665c8f61 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationStringItemView.axaml.cs @@ -0,0 +1,14 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using ReactiveUI.Avalonia; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public partial class ConfigurationStringItemView : ReactiveUserControl +{ + public ConfigurationStringItemView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationStringItemViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationStringItemViewModel.cs new file mode 100644 index 000000000..8babe67b9 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationStringItemViewModel.cs @@ -0,0 +1,14 @@ +using Artemis.Core; +using Artemis.UI.Shared; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public class ConfigurationStringItemViewModel : ActivatableViewModelBase +{ + public ConfigurationStringItem Item { get; } + + public ConfigurationStringItemViewModel(ConfigurationStringItem item) + { + Item = item; + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Slot/SlotView.axaml b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationTextItemView.axaml similarity index 60% rename from src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Slot/SlotView.axaml rename to src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationTextItemView.axaml index 05ecf5753..c3d5e69f5 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Slot/SlotView.axaml +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationTextItemView.axaml @@ -2,9 +2,9 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:slot="clr-namespace:Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Slot" + xmlns:section="clr-namespace:Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" - x:Class="Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Slot.SlotView" - x:DataType="slot:SlotViewModel"> - Welcome to Avalonia! + x:Class="Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section.ConfigurationTextItemView" + x:DataType="section:ConfigurationTextItemViewModel"> + diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Slot/SlotView.axaml.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationTextItemView.axaml.cs similarity index 51% rename from src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Slot/SlotView.axaml.cs rename to src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationTextItemView.axaml.cs index f0513e279..ec92e025f 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Slot/SlotView.axaml.cs +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationTextItemView.axaml.cs @@ -1,12 +1,13 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; +using ReactiveUI.Avalonia; -namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Slot; +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; -public partial class SlotView : UserControl +public partial class ConfigurationTextItemView : ReactiveUserControl { - public SlotView() + public ConfigurationTextItemView() { InitializeComponent(); } diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationTextItemViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationTextItemViewModel.cs new file mode 100644 index 000000000..7a6a09b84 --- /dev/null +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Section/ConfigurationTextItemViewModel.cs @@ -0,0 +1,14 @@ +using Artemis.Core; +using Artemis.UI.Shared; + +namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section; + +public class ConfigurationTextItemViewModel : ActivatableViewModelBase +{ + public ConfigurationTextItem Item { get; } + + public ConfigurationTextItemViewModel(ConfigurationTextItem item) + { + Item = item; + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Slot/SlotViewModel.cs b/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Slot/SlotViewModel.cs deleted file mode 100644 index d24258f52..000000000 --- a/src/Artemis.UI/Screens/ProfileEditor/ConfigurationPanels/Slot/SlotViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Artemis.UI.Shared; - -namespace Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Slot; - -public class SlotViewModel : ActivatableViewModelBase -{ - -} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/ProfileEditor/ConfigureProfileView.axaml b/src/Artemis.UI/Screens/ProfileEditor/ConfigureProfileView.axaml index 0ce41a1ce..28bff155b 100644 --- a/src/Artemis.UI/Screens/ProfileEditor/ConfigureProfileView.axaml +++ b/src/Artemis.UI/Screens/ProfileEditor/ConfigureProfileView.axaml @@ -7,12 +7,32 @@ x:Class="Artemis.UI.Screens.ProfileEditor.ConfigureProfileView" x:DataType="profileEditor:ConfigureProfileViewModel"> - + - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/LayoutFinder/LayoutFinderView.axaml b/src/Artemis.UI/Screens/Workshop/LayoutFinder/LayoutFinderView.axaml index 499e28bb1..d1c89daa7 100644 --- a/src/Artemis.UI/Screens/Workshop/LayoutFinder/LayoutFinderView.axaml +++ b/src/Artemis.UI/Screens/Workshop/LayoutFinder/LayoutFinderView.axaml @@ -9,7 +9,7 @@ - +