mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Design
This commit is contained in:
1 parent
77a4d8201e
commit
5a681a0480
40 files changed
+273
-262
No files matched your search
+34
@@ -0,0 +1,34 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
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:section="clr-namespace:Artemis.UI.Screens.ProfileEditor.DesignPanels.Section"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.DesignPanels.Section.ConfigurationSectionDesignView"
|
||||
x:DataType="section:ConfigurationSectionDesignViewModel">
|
||||
<Border Classes="card" VerticalAlignment="Top">
|
||||
<StackPanel>
|
||||
<TextBlock Theme="{StaticResource SubtitleTextBlockStyle}" Text="{CompiledBinding ConfigurationSection.Name}"/>
|
||||
<Border Classes="card-separator" />
|
||||
|
||||
<ItemsControl ItemsSource="{CompiledBinding Items}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Classes="device-view-model-container">
|
||||
<!-- Your existing item template goes here -->
|
||||
<ContentControl Content="{CompiledBinding}"/>
|
||||
<Border Classes="card-separator" Name="Separator" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
<ItemsControl.Styles>
|
||||
<Styles>
|
||||
<Style Selector="ContentPresenter:nth-last-child(1) > StackPanel > Border#Separator">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</Styles>
|
||||
</ItemsControl.Styles>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</UserControl>
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
using Artemis.UI.Screens.ProfileEditor.ConfigurationPanels.Section;
|
||||
using ReactiveUI.Avalonia;
|
||||
|
||||
namespace Artemis.UI.Screens.ProfileEditor.DesignPanels.Section;
|
||||
|
||||
public partial class ConfigurationSectionDesignView: ReactiveUserControl<ConfigurationSectionDesignViewModel>
|
||||
{
|
||||
public ConfigurationSectionDesignView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using Artemis.Core;
|
||||
using Artemis.UI.Screens.ProfileEditor.DesignPanels.Items;
|
||||
using Artemis.UI.Shared;
|
||||
|
||||
namespace Artemis.UI.Screens.ProfileEditor.DesignPanels.Section;
|
||||
|
||||
public class ConfigurationSectionDesignViewModel : ActivatableViewModelBase
|
||||
{
|
||||
public ConfigurationSection ConfigurationSection { get; }
|
||||
public ObservableCollection<ActivatableViewModelBase> Items { get; }
|
||||
|
||||
public ConfigurationSectionDesignViewModel(ConfigurationSection configurationSection)
|
||||
{
|
||||
ConfigurationSection = configurationSection;
|
||||
Items = [];
|
||||
foreach (IConfigurationItem item in ConfigurationSection.Items)
|
||||
{
|
||||
if (item is ConfigurationTextItem textItem)
|
||||
Items.Add(new ConfigurationTextItemDesignViewModel(textItem));
|
||||
else if (item is ConfigurationStringItem stringItem)
|
||||
Items.Add(new ConfigurationStringItemDesignViewModel(stringItem));
|
||||
else if (item is ConfigurationBooleanItem booleanItem)
|
||||
Items.Add(new ConfigurationBooleanItemDesignViewModel(booleanItem));
|
||||
else if (item is ConfigurationNumericItem numberItem)
|
||||
Items.Add(new ConfigurationNumericItemDesignViewModel(numberItem));
|
||||
else if (item is ConfigurationSKColorItem colorItem)
|
||||
Items.Add(new ConfigurationSKColorItemDesignViewModel(colorItem));
|
||||
else if (item is ConfigurationColorGradientItem colorGradientItem)
|
||||
Items.Add(new ConfigurationColorGradientItemDesignViewModel(colorGradientItem));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user