mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-11 04:48:46 +00:00
TextBox - Added prefix and suffix attached properties
NumberBox - Added prefix and suffix attached properties Profile editor - Use compiled bindings where applicable
This commit is contained in:
parent
76ef542e18
commit
9ebdaec4f1
@ -0,0 +1,55 @@
|
||||
using System.Windows.Input;
|
||||
using Avalonia;
|
||||
using FluentAvalonia.UI.Controls;
|
||||
|
||||
namespace Artemis.UI.Shared.AttachedProperties;
|
||||
|
||||
/// <summary>
|
||||
/// Helper properties for working with NumberBoxes.
|
||||
/// </summary>
|
||||
public class NumberBoxAssist : AvaloniaObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies the <seealso cref="SuffixTextProperty" /> Avalonia attached property.
|
||||
/// </summary>
|
||||
/// <value>Provide an <see cref="ICommand" /> derived object or binding.</value>
|
||||
public static readonly AttachedProperty<string> SuffixTextProperty = AvaloniaProperty.RegisterAttached<NumberBoxAssist, string>("SuffixText", typeof(NumberBox));
|
||||
|
||||
/// <summary>
|
||||
/// Identifies the <seealso cref="PrefixTextProperty" /> Avalonia attached property.
|
||||
/// </summary>
|
||||
/// <value>Provide an <see cref="ICommand" /> derived object or binding.</value>
|
||||
public static readonly AttachedProperty<string> PrefixTextProperty = AvaloniaProperty.RegisterAttached<NumberBoxAssist, string>("PrefixText", typeof(NumberBox));
|
||||
|
||||
/// <summary>
|
||||
/// Accessor for Attached property <see cref="SuffixTextProperty" />.
|
||||
/// </summary>
|
||||
public static void SetSuffixText(AvaloniaObject element, string value)
|
||||
{
|
||||
element.SetValue(SuffixTextProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accessor for Attached property <see cref="SuffixTextProperty" />.
|
||||
/// </summary>
|
||||
public static string GetSuffixText(AvaloniaObject element)
|
||||
{
|
||||
return element.GetValue(SuffixTextProperty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accessor for Attached property <see cref="PrefixTextProperty" />.
|
||||
/// </summary>
|
||||
public static void SetPrefixText(AvaloniaObject element, string value)
|
||||
{
|
||||
element.SetValue(PrefixTextProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accessor for Attached property <see cref="PrefixTextProperty" />.
|
||||
/// </summary>
|
||||
public static string GetPrefixText(AvaloniaObject element)
|
||||
{
|
||||
return element.GetValue(PrefixTextProperty);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
using System.Windows.Input;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Artemis.UI.Shared.AttachedProperties;
|
||||
|
||||
/// <summary>
|
||||
/// Helper properties for working with TextBoxes.
|
||||
/// </summary>
|
||||
public class TextBoxAssist : AvaloniaObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies the <seealso cref="SuffixTextProperty" /> Avalonia attached property.
|
||||
/// </summary>
|
||||
/// <value>Provide an <see cref="ICommand" /> derived object or binding.</value>
|
||||
public static readonly AttachedProperty<string> SuffixTextProperty = AvaloniaProperty.RegisterAttached<TextBoxAssist, string>("SuffixText", typeof(TextBox));
|
||||
|
||||
/// <summary>
|
||||
/// Identifies the <seealso cref="PrefixTextProperty" /> Avalonia attached property.
|
||||
/// </summary>
|
||||
/// <value>Provide an <see cref="ICommand" /> derived object or binding.</value>
|
||||
public static readonly AttachedProperty<string> PrefixTextProperty = AvaloniaProperty.RegisterAttached<TextBoxAssist, string>("PrefixText", typeof(TextBox));
|
||||
|
||||
/// <summary>
|
||||
/// Accessor for Attached property <see cref="SuffixTextProperty" />.
|
||||
/// </summary>
|
||||
public static void SetSuffixText(AvaloniaObject element, string value)
|
||||
{
|
||||
element.SetValue(SuffixTextProperty, value);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(value) && !((TextBox)element).Classes.Contains("suffixed"))
|
||||
((TextBox)element).Classes.Add("suffixed");
|
||||
else
|
||||
((TextBox)element).Classes.Remove("suffixed");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accessor for Attached property <see cref="SuffixTextProperty" />.
|
||||
/// </summary>
|
||||
public static string GetSuffixText(AvaloniaObject element)
|
||||
{
|
||||
return element.GetValue(SuffixTextProperty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accessor for Attached property <see cref="PrefixTextProperty" />.
|
||||
/// </summary>
|
||||
public static void SetPrefixText(AvaloniaObject element, string value)
|
||||
{
|
||||
element.SetValue(PrefixTextProperty, value);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(value) && !((TextBox)element).Classes.Contains("prefixed"))
|
||||
((TextBox)element).Classes.Add("prefixed");
|
||||
else
|
||||
((TextBox)element).Classes.Remove("prefixed");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Accessor for Attached property <see cref="PrefixTextProperty" />.
|
||||
/// </summary>
|
||||
public static string GetPrefixText(AvaloniaObject element)
|
||||
{
|
||||
return element.GetValue(PrefixTextProperty);
|
||||
}
|
||||
}
|
||||
@ -103,6 +103,16 @@ public abstract class PropertyInputViewModel<T> : PropertyInputViewModel
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the prefix to show before input elements
|
||||
/// </summary>
|
||||
public string? Prefix => LayerProperty.PropertyDescription.InputPrefix;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the affix to show after input elements
|
||||
/// </summary>
|
||||
public string? Affix => LayerProperty.PropertyDescription.InputAffix;
|
||||
|
||||
internal override object InternalGuard { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
@ -186,7 +196,6 @@ public abstract class PropertyInputViewModel<T> : PropertyInputViewModel
|
||||
{
|
||||
_updating = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void UpdateDataBinding()
|
||||
|
||||
@ -28,6 +28,8 @@
|
||||
<StyleInclude Source="/Styles/TextBlock.axaml" />
|
||||
<StyleInclude Source="/Styles/Sidebar.axaml" />
|
||||
<StyleInclude Source="/Styles/InfoBar.axaml" />
|
||||
<StyleInclude Source="/Styles/TextBox.axaml" />
|
||||
<StyleInclude Source="/Styles/NumberBox.axaml" />
|
||||
<StyleInclude Source="/Styles/TreeView.axaml" />
|
||||
|
||||
<Style Selector="Window:windows:windows10 /template/ Border#RootBorder">
|
||||
|
||||
120
src/Avalonia/Artemis.UI.Shared/Styles/NumberBox.axaml
Normal file
120
src/Avalonia/Artemis.UI.Shared/Styles/NumberBox.axaml
Normal file
@ -0,0 +1,120 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:attachedProperties="clr-namespace:Artemis.UI.Shared.AttachedProperties">
|
||||
<Design.PreviewWith>
|
||||
<Border Padding="20">
|
||||
<StackPanel Spacing="20">
|
||||
<!-- Add Controls for Previewer Here -->
|
||||
<controls:NumberBox Value="99999999"
|
||||
attachedProperties:NumberBoxAssist.PrefixText="%"
|
||||
attachedProperties:NumberBoxAssist.SuffixText="%"/>
|
||||
<controls:NumberBox Classes="condensed"
|
||||
Value="9999999"
|
||||
attachedProperties:NumberBoxAssist.PrefixText="%"
|
||||
attachedProperties:NumberBoxAssist.SuffixText="%"/>
|
||||
</StackPanel>
|
||||
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<!-- Add Styles Here -->
|
||||
<Style Selector="TextBox.NumberBoxTextBoxStyle">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<DataValidationErrors>
|
||||
<Panel>
|
||||
<Border Name="PART_BorderElement"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
MinWidth="{TemplateBinding MinWidth}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
RenderTransform="scaleY(-1)"
|
||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||
|
||||
<Border Margin="{TemplateBinding BorderThickness}">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" >
|
||||
<TextBlock Name="PART_Prefix"
|
||||
Text="{TemplateBinding attachedProperties:TextBoxAssist.PrefixText}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
IsHitTestVisible="False"/>
|
||||
<DockPanel x:Name="PART_InnerDockPanel"
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="1"
|
||||
Margin="{TemplateBinding Padding}">
|
||||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
|
||||
<Panel>
|
||||
<TextBlock Name="PART_Watermark"
|
||||
Text="{TemplateBinding Watermark}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}"
|
||||
IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNullOrEmpty}}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
IsHitTestVisible="False"/>
|
||||
<TextPresenter Name="PART_TextPresenter"
|
||||
Text="{TemplateBinding Text, Mode=TwoWay}"
|
||||
CaretIndex="{TemplateBinding CaretIndex}"
|
||||
SelectionStart="{TemplateBinding SelectionStart}"
|
||||
SelectionEnd="{TemplateBinding SelectionEnd}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}"
|
||||
PasswordChar="{TemplateBinding PasswordChar}"
|
||||
RevealPassword="{TemplateBinding RevealPassword}"
|
||||
SelectionBrush="{TemplateBinding SelectionBrush}"
|
||||
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
|
||||
CaretBrush="{TemplateBinding CaretBrush}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Panel>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
<StackPanel Orientation="Horizontal" Grid.Column="2" Grid.ColumnSpan="1">
|
||||
<TextBlock Name="PART_Suffix"
|
||||
Text="{TemplateBinding attachedProperties:TextBoxAssist.SuffixText}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
IsHitTestVisible="False"/>
|
||||
<ContentPresenter Content="{TemplateBinding InnerRightContent}"
|
||||
Name="InnerRightContent"/>
|
||||
<Viewbox Margin="{DynamicResource NumberBoxPopupIndicatorMargin}"
|
||||
VerticalAlignment="Center" HorizontalAlignment="Center"
|
||||
Width="18" Height="18"
|
||||
Name="PopupIndicator">
|
||||
<controls:FontIcon Glyph=""
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="24"
|
||||
Foreground="{DynamicResource NumberBoxPopupIndicatorForeground}" />
|
||||
</Viewbox>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Panel>
|
||||
</DataValidationErrors>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="controls|NumberBox /template/ TextBox.NumberBoxTextBoxStyle /template/ TextBlock#PART_Prefix">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}"></Setter>
|
||||
<Setter Property="Margin" Value="-4 0 -12 0"></Setter>
|
||||
</Style>
|
||||
<Style Selector="controls|NumberBox /template/ TextBox.NumberBoxTextBoxStyle /template/ TextBlock#PART_Suffix">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}"></Setter>
|
||||
<Setter Property="Margin" Value="-12 0 0 0"></Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="controls|NumberBox.condensed /template/ TextBox.NumberBoxTextBoxStyle /template/ TextBlock#PART_Prefix">
|
||||
<Setter Property="Margin" Value="0 0 -4 0"></Setter>
|
||||
</Style>
|
||||
<Style Selector="controls|NumberBox.condensed /template/ TextBox.NumberBoxTextBoxStyle /template/ TextBlock#PART_Suffix">
|
||||
<Setter Property="Margin" Value="-4 0 0 0"></Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
<Style Selector="controls|NumberBox /template/ TextBox.NumberBoxTextBoxStyle">
|
||||
<Setter Property="attachedProperties:TextBoxAssist.PrefixText" Value="{TemplateBinding attachedProperties:NumberBoxAssist.PrefixText}"></Setter>
|
||||
<Setter Property="attachedProperties:TextBoxAssist.SuffixText" Value="{TemplateBinding attachedProperties:NumberBoxAssist.SuffixText}"></Setter>
|
||||
</Style>
|
||||
</Styles>
|
||||
122
src/Avalonia/Artemis.UI.Shared/Styles/TextBox.axaml
Normal file
122
src/Avalonia/Artemis.UI.Shared/Styles/TextBox.axaml
Normal file
@ -0,0 +1,122 @@
|
||||
<Styles xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:attached="clr-namespace:Artemis.UI.Shared.AttachedProperties"
|
||||
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia">
|
||||
<Design.PreviewWith>
|
||||
<Border Padding="20">
|
||||
<StackPanel Spacing="20">
|
||||
|
||||
|
||||
<!-- Add Controls for Previewer Here -->
|
||||
<TextBox Text="99999999"
|
||||
attached:TextBoxAssist.PrefixText="%"
|
||||
attached:TextBoxAssist.SuffixText="%"></TextBox>
|
||||
<controls:NumberBox Value="99999999"
|
||||
attached:NumberBoxAssist.PrefixText="%"
|
||||
attached:NumberBoxAssist.SuffixText="%" />
|
||||
|
||||
<TextBox Classes="condensed"
|
||||
Text="9999999"
|
||||
attached:TextBoxAssist.PrefixText="%"
|
||||
attached:TextBoxAssist.SuffixText="%" />
|
||||
<controls:NumberBox Classes="condensed"
|
||||
Value="9999999"
|
||||
attached:NumberBoxAssist.PrefixText="%"
|
||||
attached:NumberBoxAssist.SuffixText="%" />
|
||||
</StackPanel>
|
||||
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
<!-- Add Styles Here -->
|
||||
<Style Selector="TextBox">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<DataValidationErrors>
|
||||
<Panel>
|
||||
<!-- This is flipped (scaleY(-1)) for the elevation brush effect
|
||||
-->
|
||||
<Border
|
||||
Name="PART_BorderElement"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
MinWidth="{TemplateBinding MinWidth}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
RenderTransform="scaleY(-1)"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"/>
|
||||
|
||||
<Border
|
||||
Margin="{TemplateBinding BorderThickness}">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" >
|
||||
<ContentPresenter Grid.Column="0" Grid.ColumnSpan="1" Content="{TemplateBinding InnerLeftContent}"/>
|
||||
<DockPanel x:Name="PART_InnerDockPanel" Grid.Column="1" Grid.ColumnSpan="1" Margin="{TemplateBinding Padding}">
|
||||
<TextBlock Name="PART_Prefix"
|
||||
Text="{TemplateBinding attached:TextBoxAssist.PrefixText}"
|
||||
IsHitTestVisible="False"
|
||||
DockPanel.Dock="Left"/>
|
||||
<TextBlock Name="PART_FloatingWatermark"
|
||||
Foreground="{DynamicResource SystemAccentColor}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
Text="{TemplateBinding Watermark}"
|
||||
DockPanel.Dock="Top" />
|
||||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
|
||||
<Panel>
|
||||
<TextBlock Name="PART_Watermark"
|
||||
Text="{TemplateBinding Watermark}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}"
|
||||
IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNullOrEmpty}}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
IsHitTestVisible="False"/>
|
||||
<TextPresenter Name="PART_TextPresenter"
|
||||
Text="{TemplateBinding Text, Mode=TwoWay}"
|
||||
CaretIndex="{TemplateBinding CaretIndex}"
|
||||
SelectionStart="{TemplateBinding SelectionStart}"
|
||||
SelectionEnd="{TemplateBinding SelectionEnd}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}"
|
||||
PasswordChar="{TemplateBinding PasswordChar}"
|
||||
RevealPassword="{TemplateBinding RevealPassword}"
|
||||
SelectionBrush="{TemplateBinding SelectionBrush}"
|
||||
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
|
||||
CaretBrush="{TemplateBinding CaretBrush}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
</Panel>
|
||||
</ScrollViewer>
|
||||
|
||||
<TextBlock Name="PART_Suffix"
|
||||
Text="{TemplateBinding attached:TextBoxAssist.SuffixText}"
|
||||
IsHitTestVisible="False"
|
||||
HorizontalAlignment="Right"
|
||||
DockPanel.Dock="Right"/>
|
||||
</DockPanel>
|
||||
<ContentPresenter Grid.Column="2" Grid.ColumnSpan="1" Content="{TemplateBinding InnerRightContent}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Panel>
|
||||
</DataValidationErrors>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="TextBox /template/ TextBlock#PART_Prefix">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}"></Setter>
|
||||
<Setter Property="Margin" Value="-4 0 4 0"></Setter>
|
||||
</Style>
|
||||
<Style Selector="TextBox /template/ TextBlock#PART_Suffix">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}"></Setter>
|
||||
<Setter Property="Margin" Value="4 0 0 0"></Setter>
|
||||
</Style>
|
||||
|
||||
<Style Selector="TextBox.condensed /template/ TextBlock#PART_Prefix">
|
||||
<Setter Property="Margin" Value="0 0 4 0"></Setter>
|
||||
</Style>
|
||||
<Style Selector="TextBox.condensed /template/ TextBlock#PART_Suffix">
|
||||
<Setter Property="Margin" Value="4 0 0 0"></Setter>
|
||||
</Style>
|
||||
|
||||
</Styles>
|
||||
@ -54,4 +54,7 @@
|
||||
<DependentUpon>PropertiesView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="DefaultTypes\DataModel\Display\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@ -1,64 +0,0 @@
|
||||
<UserControl x:Class="Artemis.UI.DefaultTypes.DataModel.Display.SKColorDataModelDisplayView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||
xmlns:display="clr-namespace:Artemis.UI.DefaultTypes.DataModel.Display"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
d:DataContext="{d:DesignInstance {x:Type display:SKColorDataModelDisplayViewModel}}">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Artemis.UI.Shared;component/Resources/ArtemisShared.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<shared:ColorToStringConverter x:Key="SKColorToStringConverter" />
|
||||
<shared:SKColorToColorConverter x:Key="SKColorToColorConverter" />
|
||||
<shared:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Prefix -->
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding PropertyDescription.Prefix}"
|
||||
Visibility="{Binding PropertyDescription.Prefix, Converter={StaticResource NullToVisibilityConverter}}"
|
||||
TextAlignment="Right"
|
||||
Margin="0 0 5 0" />
|
||||
|
||||
<!-- Value -->
|
||||
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<TextBlock x:Name="HexDisplay"
|
||||
Text="{Binding DisplayValue, Converter={StaticResource SKColorToStringConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch" />
|
||||
<Border Width="{Binding ActualHeight, ElementName=HexDisplay}"
|
||||
Height="{Binding ActualHeight, ElementName=HexDisplay}"
|
||||
CornerRadius="{Binding ActualHeight, ElementName=HexDisplay}"
|
||||
Margin="5 0 0 0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Background="{StaticResource Checkerboard}">
|
||||
<Ellipse Stroke="{DynamicResource NormalBorderBrush}">
|
||||
<Ellipse.Fill>
|
||||
<SolidColorBrush Color="{Binding DisplayValue, Converter={StaticResource SKColorToColorConverter}}" />
|
||||
</Ellipse.Fill>
|
||||
</Ellipse>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Affix -->
|
||||
<TextBlock Grid.Column="2"
|
||||
Text="{Binding PropertyDescription.Affix}"
|
||||
Visibility="{Binding PropertyDescription.Affix, Converter={StaticResource NullToVisibilityConverter}}"
|
||||
Margin="5 0 0 0" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -1,8 +0,0 @@
|
||||
using Artemis.UI.Shared.DataModelVisualization;
|
||||
using SkiaSharp;
|
||||
|
||||
namespace Artemis.UI.DefaultTypes.DataModel.Display;
|
||||
|
||||
public class SKColorDataModelDisplayViewModel : DataModelDisplayViewModel<SKColor>
|
||||
{
|
||||
}
|
||||
@ -3,7 +3,12 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
|
||||
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.BoolPropertyInputView">
|
||||
<controls:EnumComboBox Classes="condensed" Width="200" Value="{Binding SelectedBooleanOption}" VerticalAlignment="Center" />
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.BoolPropertyInputView"
|
||||
x:DataType="propertyInput:BoolPropertyInputViewModel">
|
||||
<controls:EnumComboBox Classes="condensed"
|
||||
Width="200"
|
||||
Value="{CompiledBinding SelectedBooleanOption}"
|
||||
VerticalAlignment="Center" />
|
||||
</UserControl>
|
||||
@ -4,8 +4,10 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:layerBrushes="clr-namespace:Artemis.Core.LayerBrushes;assembly=Artemis.Core"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.BrushPropertyInputView">
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.BrushPropertyInputView"
|
||||
x:DataType="propertyInput:BrushPropertyInputViewModel">
|
||||
|
||||
<UserControl.Styles>
|
||||
<Style Selector="ComboBox.brush /template/ ContentControl#ContentPresenter">
|
||||
@ -13,8 +15,8 @@
|
||||
<Setter.Value>
|
||||
<DataTemplate DataType="{x:Type layerBrushes:LayerBrushDescriptor}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<avalonia:MaterialIcon Kind="{Binding Icon}" Height="20" Width="20" VerticalAlignment="Center" Margin="0 0 5 0"/>
|
||||
<TextBlock Text="{Binding DisplayName}" VerticalAlignment="Center" />
|
||||
<avalonia:MaterialIcon Kind="{CompiledBinding Icon}" Height="20" Width="20" VerticalAlignment="Center" Margin="0 0 5 0"/>
|
||||
<TextBlock Text="{CompiledBinding DisplayName}" VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
@ -24,8 +26,8 @@
|
||||
<ComboBox Classes="brush condensed"
|
||||
Width="200"
|
||||
VerticalAlignment="Center"
|
||||
Items="{Binding Descriptors}"
|
||||
SelectedItem="{Binding SelectedDescriptor}">
|
||||
Items="{CompiledBinding Descriptors}"
|
||||
SelectedItem="{CompiledBinding SelectedDescriptor}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate DataType="{x:Type layerBrushes:LayerBrushDescriptor}">
|
||||
<Grid ColumnDefinitions="30,*" RowDefinitions="Auto,Auto">
|
||||
@ -36,8 +38,8 @@
|
||||
Width="20"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left" />
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding DisplayName}" TextWrapping="Wrap" MaxWidth="350" />
|
||||
<TextBlock Classes="subtitle" Grid.Row="1" Grid.Column="1" Text="{Binding Description}" TextWrapping="Wrap" MaxWidth="350" />
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Text="{CompiledBinding DisplayName}" TextWrapping="Wrap" MaxWidth="350" />
|
||||
<TextBlock Classes="subtitle" Grid.Row="1" Grid.Column="1" Text="{CompiledBinding Description}" TextWrapping="Wrap" MaxWidth="350" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
|
||||
@ -3,17 +3,18 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:shared="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared"
|
||||
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.FloatPropertyInputView">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||
<controls:NumberBox Classes="condensed"
|
||||
Width="100"
|
||||
Value="{Binding InputValue}"
|
||||
SmallChange="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||
AcceptsExpression="True"
|
||||
SimpleNumberFormat="F3"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.FloatPropertyInputView"
|
||||
x:DataType="propertyInput:FloatPropertyInputViewModel">
|
||||
<controls:NumberBox Classes="condensed"
|
||||
MinWidth="80"
|
||||
Value="{CompiledBinding InputValue}"
|
||||
SmallChange="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||
AcceptsExpression="True"
|
||||
SimpleNumberFormat="F3"
|
||||
VerticalAlignment="Center"
|
||||
shared:NumberBoxAssist.PrefixText="{CompiledBinding Prefix}"
|
||||
shared:NumberBoxAssist.SuffixText="{CompiledBinding Affix}"/>
|
||||
</UserControl>
|
||||
@ -3,16 +3,17 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:shared="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared"
|
||||
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.IntPropertyInputView">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputPrefix}" VerticalAlignment="Center" />
|
||||
<controls:NumberBox Classes="condensed"
|
||||
Width="100"
|
||||
Value="{Binding InputValue}"
|
||||
SmallChange="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||
AcceptsExpression="True"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock Width="25" Text="{Binding LayerProperty.PropertyDescription.InputAffix}" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.IntPropertyInputView"
|
||||
x:DataType="propertyInput:IntPropertyInputViewModel">
|
||||
<controls:NumberBox Classes="condensed"
|
||||
MinWidth="80"
|
||||
Value="{CompiledBinding InputValue}"
|
||||
SmallChange="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||
AcceptsExpression="True"
|
||||
VerticalAlignment="Center"
|
||||
shared:NumberBoxAssist.PrefixText="{CompiledBinding Prefix}"
|
||||
shared:NumberBoxAssist.SuffixText="{CompiledBinding Affix}"/>
|
||||
</UserControl>
|
||||
@ -4,29 +4,26 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
||||
xmlns:shared="clr-namespace:Artemis.UI.Shared"
|
||||
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.SKColorPropertyInputView">
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.SKColorPropertyInputView"
|
||||
x:DataType="propertyInput:SKColorPropertyInputViewModel">
|
||||
<UserControl.Resources>
|
||||
<converters:SKColorToStringConverter x:Key="SKColorToStringConverter" />
|
||||
<converters:SKColorToColor2Converter x:Key="SKColorToColor2Converter" />
|
||||
</UserControl.Resources>
|
||||
<Grid Height="24">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Classes="condensed"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Text="{Binding InputValue, Converter={StaticResource SKColorToStringConverter}}"/>
|
||||
<controls:ColorPickerButton Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Color="{Binding InputValue, Converter={StaticResource SKColorToColor2Converter}}"
|
||||
<converters:SKColorToStringConverter x:Key="SKColorToStringConverter" />
|
||||
<converters:SKColorToColor2Converter x:Key="SKColorToColor2Converter" />
|
||||
</UserControl.Resources>
|
||||
<Grid Height="24" ColumnDefinitions="*,Auto">
|
||||
<TextBox Classes="condensed"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Text="{CompiledBinding InputValue, Converter={StaticResource SKColorToStringConverter}}" />
|
||||
<controls:ColorPickerButton Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Color="{CompiledBinding InputValue, Converter={StaticResource SKColorToColor2Converter}}"
|
||||
Classes="condensed"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="-6 0 -8 0"/>
|
||||
Margin="-6 0 -8 0" />
|
||||
</Grid>
|
||||
|
||||
|
||||
</UserControl>
|
||||
@ -3,26 +3,30 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:attachedProperties="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared"
|
||||
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.SKPointPropertyInputView">
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.SKPointPropertyInputView"
|
||||
x:DataType="propertyInput:SKPointPropertyInputViewModel">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock Width="25"
|
||||
Text="{Binding LayerProperty.PropertyDescription.InputPrefix}"
|
||||
VerticalAlignment="Center" />
|
||||
<controls:NumberBox Classes="condensed"
|
||||
Value="{Binding X}"
|
||||
Value="{CompiledBinding X}"
|
||||
MinWidth="80"
|
||||
SmallChange="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||
ToolTip.Tip="X-coordinate (horizontal)"
|
||||
SimpleNumberFormat="F3"
|
||||
VerticalAlignment="Center" />
|
||||
VerticalAlignment="Center"
|
||||
attachedProperties:NumberBoxAssist.PrefixText="{CompiledBinding Prefix}"
|
||||
attachedProperties:NumberBoxAssist.SuffixText="{CompiledBinding Affix}"/>
|
||||
<TextBlock VerticalAlignment="Center">,</TextBlock>
|
||||
<controls:NumberBox Classes="condensed"
|
||||
Value="{Binding Y}"
|
||||
Value="{CompiledBinding Y}"
|
||||
MinWidth="80"
|
||||
SmallChange="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||
ToolTip.Tip="Y-coordinate (vertical)"
|
||||
SimpleNumberFormat="F3"
|
||||
VerticalAlignment="Center" />
|
||||
<TextBlock Width="25"
|
||||
Text="{Binding LayerProperty.PropertyDescription.InputAffix}"
|
||||
ToolTip.Tip="Y-coordinate (vertical)" />
|
||||
VerticalAlignment="Center"
|
||||
attachedProperties:NumberBoxAssist.PrefixText="{CompiledBinding Prefix}"
|
||||
attachedProperties:NumberBoxAssist.SuffixText="{CompiledBinding Affix}"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@ -3,27 +3,29 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:attachedProperties="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared"
|
||||
xmlns:propertyInput="clr-namespace:Artemis.UI.DefaultTypes.PropertyInput"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.SKSizePropertyInputView">
|
||||
x:Class="Artemis.UI.DefaultTypes.PropertyInput.SKSizePropertyInputView"
|
||||
x:DataType="propertyInput:SKSizePropertyInputViewModel">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<TextBlock Width="25"
|
||||
Text="{Binding LayerProperty.PropertyDescription.InputPrefix}"
|
||||
VerticalAlignment="Center" />
|
||||
<controls:NumberBox Classes="condensed"
|
||||
Value="{Binding Height}"
|
||||
Value="{CompiledBinding Height}"
|
||||
MinWidth="80"
|
||||
SmallChange="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||
ToolTip.Tip="Height"
|
||||
SimpleNumberFormat="F3"
|
||||
VerticalAlignment="Center"/>
|
||||
VerticalAlignment="Center"
|
||||
attachedProperties:NumberBoxAssist.PrefixText="{CompiledBinding Prefix}"
|
||||
attachedProperties:NumberBoxAssist.SuffixText="{CompiledBinding Affix}"/>
|
||||
<TextBlock VerticalAlignment="Center">,</TextBlock>
|
||||
<controls:NumberBox Classes="condensed"
|
||||
Value="{Binding Width}"
|
||||
Value="{CompiledBinding Width}"
|
||||
MinWidth="80"
|
||||
SmallChange="{Binding LayerProperty.PropertyDescription.InputStepSize}"
|
||||
SimpleNumberFormat="F3"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Width="25"
|
||||
Text="{Binding LayerProperty.PropertyDescription.InputAffix}"
|
||||
ToolTip.Tip="Width"
|
||||
VerticalAlignment="Center"/>
|
||||
VerticalAlignment="Center"
|
||||
attachedProperties:NumberBoxAssist.PrefixText="{CompiledBinding Prefix}"
|
||||
attachedProperties:NumberBoxAssist.SuffixText="{CompiledBinding Affix}"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@ -3,8 +3,10 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:playback="clr-namespace:Artemis.UI.Screens.ProfileEditor.Playback"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="48"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Playback.PlaybackView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Playback.PlaybackView"
|
||||
x:DataType="playback:PlaybackViewModel">
|
||||
<DockPanel Margin="8 0">
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<Button Classes="icon-button icon-button-large"
|
||||
@ -15,8 +17,8 @@
|
||||
<Button Classes="icon-button icon-button-large"
|
||||
ToolTip.Tip="Toggle play/pause (Space)" Command="{Binding TogglePlay}" Focusable="False">
|
||||
<StackPanel>
|
||||
<avalonia:MaterialIcon Kind="Play" IsVisible="{Binding !Playing}" />
|
||||
<avalonia:MaterialIcon Kind="Pause" IsVisible="{Binding Playing}" />
|
||||
<avalonia:MaterialIcon Kind="Play" IsVisible="{CompiledBinding !Playing}" />
|
||||
<avalonia:MaterialIcon Kind="Pause" IsVisible="{CompiledBinding Playing}" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Classes="icon-button icon-button-large" ToolTip.Tip="Go to start" Command="{Binding GoToStart}" Focusable="False">
|
||||
@ -32,18 +34,18 @@
|
||||
<avalonia:MaterialIcon Kind="SkipNext" />
|
||||
</Button>
|
||||
<ToggleButton Classes="icon-button icon-button-large"
|
||||
IsChecked="{Binding Repeating}"
|
||||
IsChecked="{CompiledBinding Repeating}"
|
||||
Focusable="False"
|
||||
Command="{Binding CycleRepeating}">
|
||||
<ToolTip.Tip>
|
||||
<StackPanel>
|
||||
<StackPanel IsVisible="{Binding Repeating}">
|
||||
<StackPanel IsVisible="{CompiledBinding Repeating}">
|
||||
<TextBlock Text="Repeat entire timeline"
|
||||
IsVisible="{Binding RepeatTimeline}" />
|
||||
IsVisible="{CompiledBinding RepeatTimeline}" />
|
||||
<TextBlock Text="Repeat segment"
|
||||
IsVisible="{Binding RepeatSegment}" />
|
||||
IsVisible="{CompiledBinding RepeatSegment}" />
|
||||
</StackPanel>
|
||||
<TextBlock IsVisible="{Binding !Repeating}">
|
||||
<TextBlock IsVisible="{CompiledBinding !Repeating}">
|
||||
Don't repeat the timeline
|
||||
</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">
|
||||
@ -52,12 +54,12 @@
|
||||
</StackPanel>
|
||||
</ToolTip.Tip>
|
||||
<Grid>
|
||||
<avalonia:MaterialIcon Kind="Repeat" IsVisible="{Binding RepeatTimeline}" />
|
||||
<avalonia:MaterialIcon Kind="RepeatOne" IsVisible="{Binding RepeatSegment}" />
|
||||
<avalonia:MaterialIcon Kind="Repeat" IsVisible="{CompiledBinding RepeatTimeline}" />
|
||||
<avalonia:MaterialIcon Kind="RepeatOne" IsVisible="{CompiledBinding RepeatSegment}" />
|
||||
</Grid>
|
||||
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
<TextBlock Classes="h4" Text="{Binding FormattedCurrentTime, FallbackValue=00.000}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0"/>
|
||||
<TextBlock Classes="h4" Text="{CompiledBinding FormattedCurrentTime, FallbackValue=00.000}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0"/>
|
||||
</DockPanel>
|
||||
</UserControl>
|
||||
@ -3,12 +3,14 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:profileTree="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.FolderTreeItemView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.FolderTreeItemView"
|
||||
x:DataType="profileTree:FolderTreeItemViewModel">
|
||||
<Grid ColumnDefinitions="Auto,Auto,*,Auto">
|
||||
<Button Grid.Column="0"
|
||||
ToolTip.Tip="{Binding ProfileElement.BrokenState}"
|
||||
IsVisible="{Binding ProfileElement.BrokenState, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
ToolTip.Tip="{CompiledBinding ProfileElement.BrokenState}"
|
||||
IsVisible="{CompiledBinding ProfileElement.BrokenState, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Classes="icon-button icon-button-small"
|
||||
Foreground="White"
|
||||
Background="#E74C4C"
|
||||
@ -28,16 +30,16 @@
|
||||
<TextBox Grid.Column="2"
|
||||
Margin="-5 0 0 0"
|
||||
Classes="condensed"
|
||||
IsVisible="{Binding Renaming}"
|
||||
Text="{Binding RenameValue}"
|
||||
IsVisible="{CompiledBinding Renaming}"
|
||||
Text="{CompiledBinding RenameValue}"
|
||||
x:Name="Input"
|
||||
KeyUp="InputElement_OnKeyUp"
|
||||
LostFocus="InputElement_OnLostFocus"/>
|
||||
<TextBlock Grid.Column="2" IsVisible="{Binding !Renaming}" Text="{Binding Folder.Name}" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Column="2" IsVisible="{CompiledBinding !Renaming}" Text="{Binding Folder.Name}" VerticalAlignment="Center" />
|
||||
<ToggleButton Grid.Column="3"
|
||||
Classes="icon-button icon-button-small"
|
||||
ToolTip.Tip="Toggle suspended state"
|
||||
IsChecked="{Binding Folder.Suspended}"
|
||||
IsChecked="{CompiledBinding Folder.Suspended}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="4 0">
|
||||
<avalonia:MaterialIcon Kind="Pause" />
|
||||
|
||||
@ -3,32 +3,34 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:profileTree="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.LayerTreeItemView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.LayerTreeItemView"
|
||||
x:DataType="profileTree:LayerTreeItemViewModel">
|
||||
<Grid ColumnDefinitions="Auto,Auto,*,Auto">
|
||||
<Button Grid.Column="0"
|
||||
ToolTip.Tip="{Binding ProfileElement.BrokenState}"
|
||||
IsVisible="{Binding ProfileElement.BrokenState, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
ToolTip.Tip="{CompiledBinding ProfileElement.BrokenState}"
|
||||
IsVisible="{CompiledBinding ProfileElement.BrokenState, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Classes="icon-button icon-button-small"
|
||||
Foreground="#E74C4C"
|
||||
Margin="0 0 5 0"
|
||||
Command="{Binding ShowBrokenStateExceptions}">
|
||||
<avalonia:MaterialIcon Kind="AlertCircle" />
|
||||
</Button>
|
||||
<avalonia:MaterialIcon Grid.Column="1" Kind="{Binding Layer.LayerBrush.Descriptor.Icon}" Margin="0 0 5 0" />
|
||||
<avalonia:MaterialIcon Grid.Column="1" Kind="{CompiledBinding Layer.LayerBrush.Descriptor.Icon, FallbackValue=Layers}" Margin="0 0 5 0" />
|
||||
<TextBox Grid.Column="2"
|
||||
Margin="-5 0 0 0"
|
||||
Classes="condensed"
|
||||
x:Name="Input"
|
||||
IsVisible="{Binding Renaming}"
|
||||
Text="{Binding RenameValue}"
|
||||
IsVisible="{CompiledBinding Renaming}"
|
||||
Text="{CompiledBinding RenameValue}"
|
||||
KeyUp="InputElement_OnKeyUp"
|
||||
LostFocus="InputElement_OnLostFocus"></TextBox>
|
||||
<TextBlock Grid.Column="2" IsVisible="{Binding !Renaming}" Text="{Binding Layer.Name}" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Column="2" IsVisible="{CompiledBinding !Renaming}" Text="{CompiledBinding Layer.Name}" VerticalAlignment="Center" />
|
||||
<ToggleButton Grid.Column="3"
|
||||
Classes="icon-button icon-button-small"
|
||||
ToolTip.Tip="Toggle suspended state"
|
||||
IsChecked="{Binding Layer.Suspended}"
|
||||
IsChecked="{CompiledBinding Layer.Suspended}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="4 0">
|
||||
<avalonia:MaterialIcon Kind="Pause" />
|
||||
|
||||
@ -3,60 +3,62 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:profileTree="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.ProfileTreeView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.ProfileTreeView"
|
||||
x:DataType="profileTree:ProfileTreeViewModel">
|
||||
<Grid RowDefinitions="*,Auto">
|
||||
<TreeView Classes="no-right-margin" Items="{Binding Children}" SelectedItem="{Binding SelectedChild}">
|
||||
<TreeView Classes="no-right-margin" Items="{CompiledBinding Children}" SelectedItem="{CompiledBinding SelectedChild}">
|
||||
<TreeView.Styles>
|
||||
<Style Selector="TreeViewItem">
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</TreeView.Styles>
|
||||
<TreeView.KeyBindings>
|
||||
<KeyBinding Gesture="F2" Command="{Binding SelectedChild.Rename}" />
|
||||
<KeyBinding Gesture="Delete" Command="{Binding SelectedChild.Delete}" />
|
||||
<KeyBinding Gesture="Ctrl+D" Command="{Binding SelectedChild.Duplicate}" />
|
||||
<KeyBinding Gesture="Ctrl+C" Command="{Binding SelectedChild.Copy}" />
|
||||
<KeyBinding Gesture="Ctrl+V" Command="{Binding SelectedChild.Paste}" />
|
||||
<KeyBinding Gesture="F2" Command="{CompiledBinding SelectedChild.Rename}" />
|
||||
<KeyBinding Gesture="Delete" Command="{CompiledBinding SelectedChild.Delete}" />
|
||||
<KeyBinding Gesture="Ctrl+D" Command="{CompiledBinding SelectedChild.Duplicate}" />
|
||||
<KeyBinding Gesture="Ctrl+C" Command="{CompiledBinding SelectedChild.Copy}" />
|
||||
<KeyBinding Gesture="Ctrl+V" Command="{CompiledBinding SelectedChild.Paste}" />
|
||||
</TreeView.KeyBindings>
|
||||
<TreeView.ItemTemplate>
|
||||
<TreeDataTemplate ItemsSource="{Binding Children}">
|
||||
<ContentControl Content="{Binding}">
|
||||
<ContentControl Content="{Binding}" x:DataType="profileTree:TreeItemViewModel">
|
||||
<ContentControl.ContextFlyout>
|
||||
<MenuFlyout>
|
||||
<MenuItem Header="Add new folder" Command="{Binding AddFolder}">
|
||||
<MenuItem Header="Add new folder" Command="{CompiledBinding AddFolder}">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="CreateNewFolder" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Add new layer" Command="{Binding AddLayer}">
|
||||
<MenuItem Header="Add new layer" Command="{CompiledBinding AddLayer}">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="LayersPlus" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="Duplicate" Command="{Binding Duplicate}" InputGesture="Ctrl+D">
|
||||
<MenuItem Header="Duplicate" Command="{CompiledBinding Duplicate}" InputGesture="Ctrl+D">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="ContentDuplicate" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Copy" Command="{Binding Copy}" InputGesture="Ctrl+C">
|
||||
<MenuItem Header="Copy" Command="{CompiledBinding Copy}" InputGesture="Ctrl+C">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="ContentCopy" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Paste" Command="{Binding Paste}" InputGesture="Ctrl+V">
|
||||
<MenuItem Header="Paste" Command="{CompiledBinding Paste}" InputGesture="Ctrl+V">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="ContentPaste" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator />
|
||||
<MenuItem Header="Rename" Command="{Binding Rename}" InputGesture="F2">
|
||||
<MenuItem Header="Rename" Command="{CompiledBinding Rename}" InputGesture="F2">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="RenameBox" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Delete" Command="{Binding Delete}" InputGesture="Delete">
|
||||
<MenuItem Header="Delete" Command="{CompiledBinding Delete}" InputGesture="Delete">
|
||||
<MenuItem.Icon>
|
||||
<avalonia:MaterialIcon Kind="TrashCan" />
|
||||
</MenuItem.Icon>
|
||||
@ -68,10 +70,10 @@
|
||||
</TreeView.ItemTemplate>
|
||||
</TreeView>
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Classes="icon-button" ToolTip.Tip="Add new folder to root" Command="{Binding AddFolder}">
|
||||
<Button Classes="icon-button" ToolTip.Tip="Add new folder to root" Command="{CompiledBinding AddFolder}">
|
||||
<avalonia:MaterialIcon Kind="FolderAdd" />
|
||||
</Button>
|
||||
<Button Classes="icon-button" ToolTip.Tip="Add new layer to root" Command="{Binding AddLayer}" Margin="2 0 0 0">
|
||||
<Button Classes="icon-button" ToolTip.Tip="Add new layer to root" Command="{CompiledBinding AddLayer}" Margin="2 0 0 0">
|
||||
<avalonia:MaterialIcon Kind="LayersPlus" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
@ -68,6 +68,10 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
|
||||
RenameValue = ProfileElement?.Name;
|
||||
});
|
||||
|
||||
Duplicate = ReactiveCommand.Create(() => throw new NotImplementedException());
|
||||
Copy = ReactiveCommand.Create(() => throw new NotImplementedException());
|
||||
Paste = ReactiveCommand.Create(() => throw new NotImplementedException());
|
||||
|
||||
Delete = ReactiveCommand.Create(() =>
|
||||
{
|
||||
if (ProfileElement is RenderProfileElement renderProfileElement)
|
||||
@ -106,6 +110,9 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree
|
||||
public ReactiveCommand<Unit, Unit> AddLayer { get; }
|
||||
public ReactiveCommand<Unit, Unit> AddFolder { get; }
|
||||
public ReactiveCommand<Unit, Unit> Rename { get; }
|
||||
public ReactiveCommand<Unit, Unit> Duplicate { get; }
|
||||
public ReactiveCommand<Unit, Unit> Copy { get; }
|
||||
public ReactiveCommand<Unit, Unit> Paste { get; }
|
||||
public ReactiveCommand<Unit, Unit> Delete { get; }
|
||||
|
||||
public string? RenameValue
|
||||
|
||||
@ -6,7 +6,8 @@
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties"
|
||||
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
||||
mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="350"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.PropertiesView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.PropertiesView"
|
||||
x:DataType="local:PropertiesViewModel">
|
||||
<UserControl.Styles>
|
||||
<StyleInclude Source="/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/Segment.axaml" />
|
||||
</UserControl.Styles>
|
||||
@ -15,22 +16,22 @@
|
||||
</UserControl.Resources>
|
||||
<Grid Name="ContainerGrid">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="{Binding PropertiesTreeWidth.Value, Mode=TwoWay, Converter={StaticResource DoubleToGridLengthConverter}}" />
|
||||
<ColumnDefinition Width="{CompiledBinding PropertiesTreeWidth.Value, Mode=TwoWay, Converter={StaticResource DoubleToGridLengthConverter}}" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid RowDefinitions="48,*">
|
||||
<ContentControl Grid.Row="0" Content="{Binding PlaybackViewModel}" />
|
||||
<ContentControl Grid.Row="0" Content="{CompiledBinding PlaybackViewModel}" />
|
||||
|
||||
<ScrollViewer Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Name="TreeScrollViewer"
|
||||
Offset="{Binding #TimelineScrollViewer.Offset, Mode=OneWay}"
|
||||
Offset="{CompiledBinding #TimelineScrollViewer.Offset, Mode=OneWay}"
|
||||
Background="{DynamicResource CardStrokeColorDefaultSolidBrush}">
|
||||
<ItemsControl Items="{Binding PropertyGroupViewModels}" Padding="0 0 8 0">
|
||||
<ItemsControl Items="{CompiledBinding PropertyGroupViewModels}" Padding="0 0 8 0">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<TreeDataTemplate DataType="{x:Type local:PropertyGroupViewModel}" ItemsSource="{Binding Children}">
|
||||
<ContentControl Content="{Binding TreeGroupViewModel}" />
|
||||
<TreeDataTemplate DataType="{x:Type local:PropertyGroupViewModel}" ItemsSource="{CompiledBinding Children}">
|
||||
<ContentControl Content="{CompiledBinding TreeGroupViewModel}" />
|
||||
</TreeDataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
@ -52,53 +53,53 @@
|
||||
Margin="0 18 0 0"
|
||||
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
HorizontalAlignment="Left"
|
||||
PixelsPerSecond="{Binding PixelsPerSecond}"
|
||||
HorizontalOffset="{Binding #TimelineScrollViewer.Offset.X, Mode=OneWay}"
|
||||
VisibleWidth="{Binding #TimelineScrollViewer.Bounds.Width}"
|
||||
PixelsPerSecond="{CompiledBinding PixelsPerSecond}"
|
||||
HorizontalOffset="{CompiledBinding #TimelineScrollViewer.Offset.X, Mode=OneWay}"
|
||||
VisibleWidth="{CompiledBinding #TimelineScrollViewer.Bounds.Width}"
|
||||
OffsetFirstValue="True"
|
||||
PointerReleased="TimelineHeader_OnPointerReleased"
|
||||
Width="{Binding #TimelineScrollViewer.Viewport.Width}"
|
||||
Width="{CompiledBinding #TimelineScrollViewer.Viewport.Width}"
|
||||
Cursor="Hand" />
|
||||
|
||||
<Canvas Grid.Row="0" ZIndex="2">
|
||||
<!-- Segment dividers -->
|
||||
<Line Name="TimelineLine"
|
||||
Canvas.Left="{Binding TimelineViewModel.CaretPosition}"
|
||||
Canvas.Left="{CompiledBinding TimelineViewModel.CaretPosition}"
|
||||
Cursor="SizeWestEast"
|
||||
PointerPressed="TimelineCaret_OnPointerPressed"
|
||||
PointerReleased="TimelineCaret_OnPointerReleased"
|
||||
PointerMoved="TimelineCaret_OnPointerMoved"
|
||||
StartPoint="0,0"
|
||||
EndPoint="{Binding #ContainerGrid.Bounds.BottomLeft}"
|
||||
EndPoint="{CompiledBinding #ContainerGrid.Bounds.BottomLeft}"
|
||||
StrokeThickness="2"
|
||||
Stroke="{DynamicResource SystemAccentColorLight1}">
|
||||
</Line>
|
||||
|
||||
<Line Name="StartSegmentLine"
|
||||
Canvas.Left="{Binding TimelineViewModel.StartSegmentViewModel.EndX}"
|
||||
IsVisible="{Binding !TimelineViewModel.MainSegmentViewModel.ShowAddStart}"
|
||||
Canvas.Left="{CompiledBinding TimelineViewModel.StartSegmentViewModel.EndX}"
|
||||
IsVisible="{CompiledBinding !TimelineViewModel.MainSegmentViewModel.ShowAddStart}"
|
||||
StartPoint="0,0"
|
||||
EndPoint="{Binding #ContainerGrid.Bounds.BottomLeft}"
|
||||
EndPoint="{CompiledBinding #ContainerGrid.Bounds.BottomLeft}"
|
||||
StrokeThickness="2"
|
||||
Stroke="{DynamicResource SystemAccentColorLight1}"
|
||||
StrokeDashArray="6,2"
|
||||
Opacity="0.5">
|
||||
</Line>
|
||||
<Line Name="MainSegmentLine"
|
||||
Canvas.Left="{Binding TimelineViewModel.MainSegmentViewModel.EndX}"
|
||||
IsVisible="{Binding !TimelineViewModel.MainSegmentViewModel.ShowAddMain}"
|
||||
Canvas.Left="{CompiledBinding TimelineViewModel.MainSegmentViewModel.EndX}"
|
||||
IsVisible="{CompiledBinding !TimelineViewModel.MainSegmentViewModel.ShowAddMain}"
|
||||
StartPoint="0,0"
|
||||
EndPoint="{Binding #ContainerGrid.Bounds.BottomLeft}"
|
||||
EndPoint="{CompiledBinding #ContainerGrid.Bounds.BottomLeft}"
|
||||
StrokeThickness="2"
|
||||
Stroke="{DynamicResource SystemAccentColorLight1}"
|
||||
StrokeDashArray="6,2"
|
||||
Opacity="0.5">
|
||||
</Line>
|
||||
<Line Name="EndSegmentLine"
|
||||
Canvas.Left="{Binding TimelineViewModel.EndSegmentViewModel.EndX}"
|
||||
IsVisible="{Binding !TimelineViewModel.MainSegmentViewModel.ShowAddEnd}"
|
||||
Canvas.Left="{CompiledBinding TimelineViewModel.EndSegmentViewModel.EndX}"
|
||||
IsVisible="{CompiledBinding !TimelineViewModel.MainSegmentViewModel.ShowAddEnd}"
|
||||
StartPoint="0,0"
|
||||
EndPoint="{Binding #ContainerGrid.Bounds.BottomLeft}"
|
||||
EndPoint="{CompiledBinding #ContainerGrid.Bounds.BottomLeft}"
|
||||
StrokeThickness="2"
|
||||
Stroke="{DynamicResource SystemAccentColorLight1}"
|
||||
StrokeDashArray="6,2"
|
||||
@ -106,19 +107,19 @@
|
||||
</Line>
|
||||
|
||||
<!-- Timeline segments -->
|
||||
<ContentControl Canvas.Left="{Binding TimelineViewModel.EndSegmentViewModel.StartX}"
|
||||
<ContentControl Canvas.Left="{CompiledBinding TimelineViewModel.EndSegmentViewModel.StartX}"
|
||||
Classes="segment-content-control"
|
||||
Content="{Binding TimelineViewModel.EndSegmentViewModel}" />
|
||||
<ContentControl Canvas.Left="{Binding TimelineViewModel.MainSegmentViewModel.StartX}"
|
||||
Content="{CompiledBinding TimelineViewModel.EndSegmentViewModel}" />
|
||||
<ContentControl Canvas.Left="{CompiledBinding TimelineViewModel.MainSegmentViewModel.StartX}"
|
||||
Classes="segment-content-control"
|
||||
Content="{Binding TimelineViewModel.MainSegmentViewModel}" />
|
||||
<ContentControl Canvas.Left="{Binding TimelineViewModel.StartSegmentViewModel.StartX}"
|
||||
Content="{CompiledBinding TimelineViewModel.MainSegmentViewModel}" />
|
||||
<ContentControl Canvas.Left="{CompiledBinding TimelineViewModel.StartSegmentViewModel.StartX}"
|
||||
Classes="segment-content-control"
|
||||
Content="{Binding TimelineViewModel.StartSegmentViewModel}" />
|
||||
Content="{CompiledBinding TimelineViewModel.StartSegmentViewModel}" />
|
||||
|
||||
<!-- Timeline caret -->
|
||||
<Polygon Name="TimelineCaret"
|
||||
Canvas.Left="{Binding TimelineViewModel.CaretPosition}"
|
||||
Canvas.Left="{CompiledBinding TimelineViewModel.CaretPosition}"
|
||||
Cursor="SizeWestEast"
|
||||
PointerPressed="TimelineCaret_OnPointerPressed"
|
||||
PointerReleased="TimelineCaret_OnPointerReleased"
|
||||
@ -130,9 +131,9 @@
|
||||
|
||||
<ScrollViewer Grid.Row="1"
|
||||
Name="TimelineScrollViewer"
|
||||
Offset="{Binding #TreeScrollViewer.Offset, Mode=OneWay}"
|
||||
Offset="{CompiledBinding #TreeScrollViewer.Offset, Mode=OneWay}"
|
||||
VerticalScrollBarVisibility="Hidden">
|
||||
<ContentControl Content="{Binding TimelineViewModel}"
|
||||
<ContentControl Content="{CompiledBinding TimelineViewModel}"
|
||||
Background="{DynamicResource CardStrokeColorDefaultSolidBrush}" />
|
||||
</ScrollViewer>
|
||||
|
||||
|
||||
@ -2,16 +2,18 @@
|
||||
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:keyframes="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes.TimelineEasingView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes.TimelineEasingView"
|
||||
x:DataType="keyframes:TimelineEasingViewModel">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Polyline Stroke="{DynamicResource TextFillColorPrimaryBrush}"
|
||||
StrokeThickness="1"
|
||||
Points="{Binding EasingPoints}"
|
||||
Points="{CompiledBinding EasingPoints}"
|
||||
Stretch="Uniform"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="0 0 10 0" />
|
||||
<TextBlock Text="{Binding Description}" />
|
||||
<TextBlock Text="{CompiledBinding Description}" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@ -3,15 +3,17 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:segments="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="18"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments.EndSegmentView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments.EndSegmentView"
|
||||
x:DataType="segments:EndSegmentViewModel">
|
||||
<UserControl.Styles>
|
||||
<StyleInclude Source="/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/Segment.axaml" />
|
||||
</UserControl.Styles>
|
||||
<Border Classes="segment-container">
|
||||
<Grid Name="SegmentGrid"
|
||||
Background="{DynamicResource CardStrokeColorDefaultSolidBrush}"
|
||||
Width="{Binding Width}"
|
||||
Width="{CompiledBinding Width}"
|
||||
ColumnDefinitions="Auto, Auto,*,Auto">
|
||||
|
||||
<Rectangle Name="KeyframeDragVisualLeft"
|
||||
@ -23,7 +25,7 @@
|
||||
Classes="AppBarButton icon-button icon-button-small"
|
||||
ToolTip.Tip="Add main segment"
|
||||
Command="{Binding AddMainSegment}"
|
||||
IsVisible="{Binding ShowAddMain}">
|
||||
IsVisible="{CompiledBinding ShowAddMain}">
|
||||
<avalonia:MaterialIcon Kind="PlusCircle" />
|
||||
</Button>
|
||||
|
||||
@ -50,7 +52,7 @@
|
||||
PointerPressed="KeyframeDragAnchor_OnPointerPressed"
|
||||
PointerMoved="KeyframeDragAnchor_OnPointerMoved"
|
||||
PointerReleased="KeyframeDragAnchor_OnPointerReleased"
|
||||
ToolTip.Tip="{Binding EndTimestamp}"/>
|
||||
ToolTip.Tip="{CompiledBinding EndTimestamp}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
@ -3,20 +3,22 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:segments="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="18"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments.MainSegmentView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments.MainSegmentView"
|
||||
x:DataType="segments:MainSegmentViewModel">
|
||||
<UserControl.Styles>
|
||||
<StyleInclude Source="/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/Segment.axaml" />
|
||||
</UserControl.Styles>
|
||||
<Border Classes="segment-container">
|
||||
<Grid Name="SegmentGrid"
|
||||
Background="{DynamicResource CardStrokeColorDefaultSolidBrush}"
|
||||
Width="{Binding Width}"
|
||||
Width="{CompiledBinding Width}"
|
||||
ColumnDefinitions="Auto,Auto,*,Auto,Auto">
|
||||
|
||||
<Rectangle Name="KeyframeDragVisualLeft"
|
||||
Grid.Column="0"
|
||||
IsVisible="{Binding !ShowAddStart}"
|
||||
IsVisible="{CompiledBinding !ShowAddStart}"
|
||||
Classes="resize-visual" />
|
||||
|
||||
<Button Name="AddStartSegment"
|
||||
@ -25,7 +27,7 @@
|
||||
VerticalAlignment="Center"
|
||||
ToolTip.Tip="Add a start segment"
|
||||
Command="{Binding AddStartSegment}"
|
||||
IsVisible="{Binding ShowAddStart}">
|
||||
IsVisible="{CompiledBinding ShowAddStart}">
|
||||
<avalonia:MaterialIcon Kind="PlusCircle" />
|
||||
</Button>
|
||||
|
||||
@ -47,7 +49,7 @@
|
||||
<ToggleButton Name="SegmentRepeat"
|
||||
Classes="icon-button icon-button-small"
|
||||
ToolTip.Tip="Repeat this segment"
|
||||
IsChecked="{Binding RepeatSegment}"
|
||||
IsChecked="{CompiledBinding RepeatSegment}"
|
||||
Padding="0">
|
||||
<avalonia:MaterialIcon Kind="Repeat" />
|
||||
</ToggleButton>
|
||||
@ -59,7 +61,7 @@
|
||||
VerticalAlignment="Center"
|
||||
ToolTip.Tip="Add an end segment"
|
||||
Command="{Binding AddEndSegment}"
|
||||
IsVisible="{Binding ShowAddEnd}">
|
||||
IsVisible="{CompiledBinding ShowAddEnd}">
|
||||
<avalonia:MaterialIcon Kind="PlusCircle" />
|
||||
</Button>
|
||||
|
||||
@ -72,7 +74,7 @@
|
||||
PointerPressed="KeyframeDragAnchor_OnPointerPressed"
|
||||
PointerMoved="KeyframeDragAnchor_OnPointerMoved"
|
||||
PointerReleased="KeyframeDragAnchor_OnPointerReleased"
|
||||
ToolTip.Tip="{Binding EndTimestamp}"/>
|
||||
ToolTip.Tip="{CompiledBinding EndTimestamp}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</UserControl>
|
||||
@ -13,24 +13,18 @@ namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments;
|
||||
|
||||
public class MainSegmentViewModel : TimelineSegmentViewModel
|
||||
{
|
||||
private readonly IProfileEditorService _profileEditorService;
|
||||
private RenderProfileElement? _profileElement;
|
||||
private int _pixelsPerSecond;
|
||||
private TimeSpan _time;
|
||||
private ObservableAsPropertyHelper<double>? _start;
|
||||
private ObservableAsPropertyHelper<double>? _end;
|
||||
private ObservableAsPropertyHelper<string?>? _endTimestamp;
|
||||
private ObservableAsPropertyHelper<bool>? _repeatSegment;
|
||||
private readonly ObservableAsPropertyHelper<double> _width;
|
||||
private TimeSpan _initialLength;
|
||||
|
||||
public MainSegmentViewModel(IProfileEditorService profileEditorService) : base(profileEditorService)
|
||||
{
|
||||
_profileEditorService = profileEditorService;
|
||||
this.WhenActivated(d =>
|
||||
{
|
||||
profileEditorService.ProfileElement.Subscribe(p => _profileElement = p).DisposeWith(d);
|
||||
profileEditorService.Time.Subscribe(t => _time = t).DisposeWith(d);
|
||||
profileEditorService.PixelsPerSecond.Subscribe(p => _pixelsPerSecond = p).DisposeWith(d);
|
||||
|
||||
_start = profileEditorService.ProfileElement
|
||||
.Select(p => p?.WhenAnyValue(element => element.Timeline.MainSegmentStartPosition) ?? Observable.Never<TimeSpan>())
|
||||
@ -50,6 +44,12 @@ public class MainSegmentViewModel : TimelineSegmentViewModel
|
||||
.Select(p => $"{Math.Floor(p.TotalSeconds):00}.{p.Milliseconds:000}")
|
||||
.ToProperty(this, vm => vm.EndTimestamp)
|
||||
.DisposeWith(d);
|
||||
_repeatSegment = profileEditorService.ProfileElement
|
||||
.Select(p => p?.WhenAnyValue(element => element.Timeline.PlayMode) ?? Observable.Never<TimelinePlayMode>())
|
||||
.Switch()
|
||||
.Select(p => p == TimelinePlayMode.Repeat)
|
||||
.ToProperty(this, vm => vm.RepeatSegment)
|
||||
.DisposeWith(d);
|
||||
});
|
||||
|
||||
_width = this.WhenAnyValue(vm => vm.StartX, vm => vm.EndX).Select(t => t.Item2 - t.Item1).ToProperty(this, vm => vm.Width);
|
||||
@ -59,6 +59,7 @@ public class MainSegmentViewModel : TimelineSegmentViewModel
|
||||
public override double StartX => _start?.Value ?? 0;
|
||||
public override TimeSpan End => _profileElement?.Timeline.MainSegmentEndPosition ?? TimeSpan.Zero;
|
||||
public override double EndX => _end?.Value ?? 0;
|
||||
|
||||
public override TimeSpan Length
|
||||
{
|
||||
get => _profileElement?.Timeline.MainSegmentLength ?? TimeSpan.Zero;
|
||||
@ -70,7 +71,12 @@ public class MainSegmentViewModel : TimelineSegmentViewModel
|
||||
}
|
||||
|
||||
public override double Width => _width.Value;
|
||||
|
||||
public override string? EndTimestamp => _endTimestamp?.Value;
|
||||
public override ResizeTimelineSegment.SegmentType Type => ResizeTimelineSegment.SegmentType.Main;
|
||||
|
||||
public bool RepeatSegment
|
||||
{
|
||||
get => _repeatSegment?.Value ?? false;
|
||||
set => throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@ -4,15 +4,17 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:system="clr-namespace:System;assembly=System.Runtime"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:segments="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="18"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments.StartSegmentView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments.StartSegmentView"
|
||||
x:DataType="segments:StartSegmentViewModel">
|
||||
<UserControl.Styles>
|
||||
<StyleInclude Source="/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/Segment.axaml" />
|
||||
</UserControl.Styles>
|
||||
<Border Classes="segment-container">
|
||||
<Grid Name="SegmentGrid"
|
||||
Background="{DynamicResource CardStrokeColorDefaultSolidBrush}"
|
||||
Width="{Binding Width}"
|
||||
Width="{CompiledBinding Width}"
|
||||
ColumnDefinitions="*,Auto,Auto">
|
||||
|
||||
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
@ -34,7 +36,7 @@
|
||||
Classes="AppBarButton icon-button icon-button-small"
|
||||
ToolTip.Tip="Add main segment"
|
||||
Command="{Binding AddMainSegment}"
|
||||
IsVisible="{Binding ShowAddMain}">
|
||||
IsVisible="{CompiledBinding ShowAddMain}">
|
||||
<avalonia:MaterialIcon Kind="PlusCircle" />
|
||||
</Button>
|
||||
|
||||
@ -47,7 +49,7 @@
|
||||
PointerPressed="KeyframeDragAnchor_OnPointerPressed"
|
||||
PointerMoved="KeyframeDragAnchor_OnPointerMoved"
|
||||
PointerReleased="KeyframeDragAnchor_OnPointerReleased"
|
||||
ToolTip.Tip="{Binding EndTimestamp}"/>
|
||||
ToolTip.Tip="{CompiledBinding EndTimestamp}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
|
||||
@ -3,18 +3,15 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:properties="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties"
|
||||
xmlns:timeline="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.TimelineGroupView">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="28" />
|
||||
<RowDefinition Height="1" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.TimelineGroupView"
|
||||
x:DataType="timeline:TimelineGroupViewModel">
|
||||
<Grid RowDefinitions="28,1,Auto">
|
||||
<ItemsControl Grid.Row="0"
|
||||
Height="{DynamicResource RailsHeight}"
|
||||
IsVisible="{Binding !PropertyGroupViewModel.IsExpanded}"
|
||||
Items="{Binding KeyframePositions}"
|
||||
IsVisible="{CompiledBinding !PropertyGroupViewModel.IsExpanded}"
|
||||
Items="{CompiledBinding KeyframePositions}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
@ -41,15 +38,15 @@
|
||||
<Rectangle Grid.Row="1" HorizontalAlignment="Stretch" Fill="{DynamicResource ButtonBorderBrush}" Height="1" />
|
||||
|
||||
<ItemsControl Grid.Row="2"
|
||||
Items="{Binding Children}"
|
||||
IsVisible="{Binding PropertyGroupViewModel.IsExpanded}"
|
||||
Items="{CompiledBinding Children}"
|
||||
IsVisible="{CompiledBinding PropertyGroupViewModel.IsExpanded}"
|
||||
HorizontalAlignment="Stretch">
|
||||
<ItemsControl.DataTemplates>
|
||||
<DataTemplate DataType="properties:PropertyGroupViewModel">
|
||||
<ContentControl Content="{Binding TimelineGroupViewModel}" IsVisible="{Binding IsVisible}" />
|
||||
<ContentControl Content="{CompiledBinding TimelineGroupViewModel}" IsVisible="{CompiledBinding IsVisible}" />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="properties:PropertyViewModel">
|
||||
<ContentControl Content="{Binding TimelinePropertyViewModel}" IsVisible="{Binding IsVisible}" />
|
||||
<ContentControl Content="{CompiledBinding TimelinePropertyViewModel}" IsVisible="{CompiledBinding IsVisible}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.DataTemplates>
|
||||
</ItemsControl>
|
||||
|
||||
@ -10,7 +10,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline;
|
||||
|
||||
public class TimelineGroupViewModel : ActivatableViewModelBase
|
||||
{
|
||||
private ObservableCollection<double>? _keyframePosition;
|
||||
private ObservableCollection<double>? _keyframePositions;
|
||||
private int _pixelsPerSecond;
|
||||
|
||||
public TimelineGroupViewModel(PropertyGroupViewModel propertyGroupViewModel, IProfileEditorService profileEditorService)
|
||||
@ -33,15 +33,15 @@ public class TimelineGroupViewModel : ActivatableViewModelBase
|
||||
|
||||
public ObservableCollection<ViewModelBase>? Children => PropertyGroupViewModel.IsExpanded ? PropertyGroupViewModel.Children : null;
|
||||
|
||||
public ObservableCollection<double>? KeyframePosition
|
||||
public ObservableCollection<double>? KeyframePositions
|
||||
{
|
||||
get => _keyframePosition;
|
||||
set => this.RaiseAndSetIfChanged(ref _keyframePosition, value);
|
||||
get => _keyframePositions;
|
||||
set => this.RaiseAndSetIfChanged(ref _keyframePositions, value);
|
||||
}
|
||||
|
||||
private void UpdateKeyframePositions()
|
||||
{
|
||||
KeyframePosition = new ObservableCollection<double>(PropertyGroupViewModel
|
||||
KeyframePositions = new ObservableCollection<double>(PropertyGroupViewModel
|
||||
.GetAllKeyframeViewModels(false)
|
||||
.Select(p => p.Position.TotalSeconds * _pixelsPerSecond));
|
||||
}
|
||||
|
||||
@ -4,8 +4,10 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties"
|
||||
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
|
||||
xmlns:timeline="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Timeline"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.TimelineView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.TimelineView"
|
||||
x:DataType="timeline:TimelineViewModel">
|
||||
<UserControl.Resources>
|
||||
<x:Double x:Key="RailsHeight">28</x:Double>
|
||||
<x:Double x:Key="RailsBorderHeight">29</x:Double>
|
||||
@ -14,14 +16,14 @@
|
||||
<Grid.KeyBindings>
|
||||
<KeyBinding Command="{Binding DeleteKeyframes}" Gesture="Delete"/>
|
||||
</Grid.KeyBindings>
|
||||
<ItemsControl Items="{Binding PropertyGroupViewModels}">
|
||||
<ItemsControl Items="{CompiledBinding PropertyGroupViewModels}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<TreeDataTemplate DataType="{x:Type local:PropertyGroupViewModel}" ItemsSource="{Binding Children}">
|
||||
<ContentControl Content="{Binding TimelineGroupViewModel}" />
|
||||
<TreeDataTemplate DataType="{x:Type local:PropertyGroupViewModel}" ItemsSource="{CompiledBinding Children}">
|
||||
<ContentControl Content="{CompiledBinding TimelineGroupViewModel}" />
|
||||
</TreeDataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<controls:SelectionRectangle Name="SelectionRectangle" InputElement="{Binding $parent}" SelectionFinished="SelectionRectangle_OnSelectionFinished"></controls:SelectionRectangle>
|
||||
<controls:SelectionRectangle Name="SelectionRectangle" InputElement="{CompiledBinding $parent}" SelectionFinished="SelectionRectangle_OnSelectionFinished"></controls:SelectionRectangle>
|
||||
</Grid>
|
||||
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
ToolTip.Tip="{Binding LayerProperty.PropertyDescription.Description}" />
|
||||
|
||||
<Button Grid.Column="3"
|
||||
Margin="0 0 2 0"
|
||||
Command="{Binding ResetToDefault}"
|
||||
Classes="icon-button"
|
||||
ToolTip.Tip="Reset the property to its default value."
|
||||
@ -50,6 +51,7 @@
|
||||
</Button>
|
||||
|
||||
<ToggleButton Grid.Column="4" Classes="icon-button"
|
||||
Margin="2 0 0 0"
|
||||
ToolTip.Tip="Change the property's data binding"
|
||||
Width="24"
|
||||
Height="24"
|
||||
|
||||
@ -5,8 +5,10 @@
|
||||
xmlns:paz="clr-namespace:Avalonia.Controls.PanAndZoom;assembly=Avalonia.Controls.PanAndZoom"
|
||||
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
|
||||
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
|
||||
xmlns:visualEditor="clr-namespace:Artemis.UI.Screens.ProfileEditor.VisualEditor"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.VisualEditor.VisualEditorView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.VisualEditor.VisualEditorView"
|
||||
x:DataType="visualEditor:VisualEditorViewModel">
|
||||
<Grid>
|
||||
<paz:ZoomBorder Name="ZoomBorder"
|
||||
Stretch="None"
|
||||
@ -23,7 +25,7 @@
|
||||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.2" Easing="CubicEaseOut"/>
|
||||
</Transitions>
|
||||
</Grid.Transitions>
|
||||
<ItemsControl Items="{Binding Devices}" ClipToBounds="False">
|
||||
<ItemsControl Items="{CompiledBinding Devices}" ClipToBounds="False">
|
||||
<ItemsControl.Styles>
|
||||
<Style Selector="ContentPresenter">
|
||||
<Setter Property="Canvas.Left" Value="{Binding X}" />
|
||||
@ -48,8 +50,8 @@
|
||||
<SolidColorBrush Color="{DynamicResource CardStrokeColorDefaultSolid}" Opacity="0.65"></SolidColorBrush>
|
||||
</Border.Background>
|
||||
<StackPanel Orientation="Horizontal" Margin="8">
|
||||
<controls:ProfileConfigurationIcon ConfigurationIcon="{Binding ProfileConfiguration.Icon}" Margin="0 0 5 0"></controls:ProfileConfigurationIcon>
|
||||
<TextBlock Text="{Binding ProfileConfiguration.Name}"/>
|
||||
<controls:ProfileConfigurationIcon ConfigurationIcon="{CompiledBinding ProfileConfiguration.Icon}" Margin="0 0 5 0"></controls:ProfileConfigurationIcon>
|
||||
<TextBlock Text="{CompiledBinding ProfileConfiguration.Name}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@ -5,14 +5,16 @@
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
||||
xmlns:profileEditor="clr-namespace:Artemis.UI.Screens.ProfileEditor"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileEditorView">
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.ProfileEditorView"
|
||||
x:DataType="profileEditor:ProfileEditorViewModel">
|
||||
<UserControl.Resources>
|
||||
<converters:DoubleToGridLengthConverter x:Key="DoubleToGridLengthConverter"></converters:DoubleToGridLengthConverter>
|
||||
</UserControl.Resources>
|
||||
<UserControl.KeyBindings>
|
||||
<KeyBinding Command="{Binding History.Undo}" Gesture="Ctrl+Z"></KeyBinding>
|
||||
<KeyBinding Command="{Binding History.Redo}" Gesture="Ctrl+Y"></KeyBinding>
|
||||
<KeyBinding Command="{CompiledBinding History.Undo}" Gesture="Ctrl+Z"></KeyBinding>
|
||||
<KeyBinding Command="{CompiledBinding History.Redo}" Gesture="Ctrl+Y"></KeyBinding>
|
||||
</UserControl.KeyBindings>
|
||||
<UserControl.Styles>
|
||||
<Style Selector="GridSplitter.editor-grid-splitter-vertical">
|
||||
@ -43,18 +45,18 @@
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="{Binding TreeWidth.Value, Mode=TwoWay, Converter={StaticResource DoubleToGridLengthConverter}}"/>
|
||||
<ColumnDefinition Width="{CompiledBinding TreeWidth.Value, Mode=TwoWay, Converter={StaticResource DoubleToGridLengthConverter}}"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ContentControl Content="{Binding MenuBarViewModel}"></ContentControl>
|
||||
<ContentControl Content="{CompiledBinding MenuBarViewModel}"></ContentControl>
|
||||
<Grid Grid.Row="0" Grid.Column="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="{Binding PropertiesHeight.Value, Mode=TwoWay, Converter={StaticResource DoubleToGridLengthConverter}}"/>
|
||||
<RowDefinition Height="{CompiledBinding PropertiesHeight.Value, Mode=TwoWay, Converter={StaticResource DoubleToGridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Classes="card" Padding="0" Margin="4 0 4 4" ClipToBounds="True">
|
||||
<Grid ColumnDefinitions="Auto,*">
|
||||
@ -74,14 +76,14 @@
|
||||
</ToggleButton>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<ContentControl Grid.Column="1" Content="{Binding VisualEditorViewModel}" />
|
||||
<ContentControl Grid.Column="1" Content="{CompiledBinding VisualEditorViewModel}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<GridSplitter Grid.Row="1" Classes="editor-grid-splitter-horizontal" />
|
||||
|
||||
<Border Grid.Row="2" Classes="card card-condensed" Margin="4" Padding="0" ClipToBounds="True">
|
||||
<ContentControl Content="{Binding PropertiesViewModel}"/>
|
||||
<ContentControl Content="{CompiledBinding PropertiesViewModel}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@ -91,10 +93,10 @@
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="{Binding ConditionsHeight.Value, Mode=TwoWay, Converter={StaticResource DoubleToGridLengthConverter}}"/>
|
||||
<RowDefinition Height="{CompiledBinding ConditionsHeight.Value, Mode=TwoWay, Converter={StaticResource DoubleToGridLengthConverter}}"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Grid.Row="0" Classes="card card-condensed" Margin="4 0 4 4">
|
||||
<ContentControl Content="{Binding ProfileTreeViewModel}" />
|
||||
<ContentControl Content="{CompiledBinding ProfileTreeViewModel}" />
|
||||
</Border>
|
||||
|
||||
<GridSplitter Grid.Row="1" Classes="editor-grid-splitter-horizontal" />
|
||||
@ -104,6 +106,6 @@
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
<ContentControl Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Content="{Binding StatusBarViewModel}"/>
|
||||
<ContentControl Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3" Content="{CompiledBinding StatusBarViewModel}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@ -4,28 +4,38 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:builders="clr-namespace:Artemis.UI.Shared.Services.Builders;assembly=Artemis.UI.Shared"
|
||||
xmlns:controls="clr-namespace:Artemis.UI.Shared.Controls;assembly=Artemis.UI.Shared"
|
||||
xmlns:controls1="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:attachedProperties="clr-namespace:Artemis.UI.Shared.AttachedProperties;assembly=Artemis.UI.Shared"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.Workshop.WorkshopView">
|
||||
<Border Classes="router-container">
|
||||
<StackPanel Margin="12">
|
||||
<TextBlock>Workshop!! :3</TextBlock>
|
||||
<Border Classes="card" Margin="0 12">
|
||||
<StackPanel>
|
||||
<StackPanel Spacing="5">
|
||||
<TextBlock Classes="h4">Notification tests</TextBlock>
|
||||
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Informational}">
|
||||
<Button Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Informational}">
|
||||
Notification test (default)
|
||||
</Button>
|
||||
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Warning}">
|
||||
<Button Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Warning}">
|
||||
Notification test (warning)
|
||||
</Button>
|
||||
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Error}">
|
||||
<Button Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Error}">
|
||||
Notification test (error)
|
||||
</Button>
|
||||
<Button Margin="0 5" Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Success}">
|
||||
<Button Command="{Binding ShowNotification}" CommandParameter="{x:Static builders:NotificationSeverity.Success}">
|
||||
Notification test (success)
|
||||
</Button>
|
||||
|
||||
<controls:HotkeyBox Watermark="Some hotkey" Width="250" HorizontalAlignment="Left" />
|
||||
|
||||
<controls1:NumberBox
|
||||
attachedProperties:NumberBoxAssist.PrefixText="$"
|
||||
attachedProperties:NumberBoxAssist.SuffixText="%"></controls1:NumberBox>
|
||||
|
||||
<TextBox
|
||||
attachedProperties:TextBoxAssist.PrefixText="$"
|
||||
attachedProperties:TextBoxAssist.SuffixText="%"></TextBox>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user