diff --git a/src/Avalonia/Artemis.UI.Shared/AttachedProperties/NumberBoxAssist.cs b/src/Avalonia/Artemis.UI.Shared/AttachedProperties/NumberBoxAssist.cs new file mode 100644 index 000000000..91d873df0 --- /dev/null +++ b/src/Avalonia/Artemis.UI.Shared/AttachedProperties/NumberBoxAssist.cs @@ -0,0 +1,55 @@ +using System.Windows.Input; +using Avalonia; +using FluentAvalonia.UI.Controls; + +namespace Artemis.UI.Shared.AttachedProperties; + +/// +/// Helper properties for working with NumberBoxes. +/// +public class NumberBoxAssist : AvaloniaObject +{ + /// + /// Identifies the Avalonia attached property. + /// + /// Provide an derived object or binding. + public static readonly AttachedProperty SuffixTextProperty = AvaloniaProperty.RegisterAttached("SuffixText", typeof(NumberBox)); + + /// + /// Identifies the Avalonia attached property. + /// + /// Provide an derived object or binding. + public static readonly AttachedProperty PrefixTextProperty = AvaloniaProperty.RegisterAttached("PrefixText", typeof(NumberBox)); + + /// + /// Accessor for Attached property . + /// + public static void SetSuffixText(AvaloniaObject element, string value) + { + element.SetValue(SuffixTextProperty, value); + } + + /// + /// Accessor for Attached property . + /// + public static string GetSuffixText(AvaloniaObject element) + { + return element.GetValue(SuffixTextProperty); + } + + /// + /// Accessor for Attached property . + /// + public static void SetPrefixText(AvaloniaObject element, string value) + { + element.SetValue(PrefixTextProperty, value); + } + + /// + /// Accessor for Attached property . + /// + public static string GetPrefixText(AvaloniaObject element) + { + return element.GetValue(PrefixTextProperty); + } +} \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI.Shared/AttachedProperties/TextBoxAssist.cs b/src/Avalonia/Artemis.UI.Shared/AttachedProperties/TextBoxAssist.cs new file mode 100644 index 000000000..7a822a99d --- /dev/null +++ b/src/Avalonia/Artemis.UI.Shared/AttachedProperties/TextBoxAssist.cs @@ -0,0 +1,65 @@ +using System.Windows.Input; +using Avalonia; +using Avalonia.Controls; + +namespace Artemis.UI.Shared.AttachedProperties; + +/// +/// Helper properties for working with TextBoxes. +/// +public class TextBoxAssist : AvaloniaObject +{ + /// + /// Identifies the Avalonia attached property. + /// + /// Provide an derived object or binding. + public static readonly AttachedProperty SuffixTextProperty = AvaloniaProperty.RegisterAttached("SuffixText", typeof(TextBox)); + + /// + /// Identifies the Avalonia attached property. + /// + /// Provide an derived object or binding. + public static readonly AttachedProperty PrefixTextProperty = AvaloniaProperty.RegisterAttached("PrefixText", typeof(TextBox)); + + /// + /// Accessor for Attached property . + /// + 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"); + } + + /// + /// Accessor for Attached property . + /// + public static string GetSuffixText(AvaloniaObject element) + { + return element.GetValue(SuffixTextProperty); + } + + /// + /// Accessor for Attached property . + /// + 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"); + } + + /// + /// Accessor for Attached property . + /// + public static string GetPrefixText(AvaloniaObject element) + { + return element.GetValue(PrefixTextProperty); + } +} \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI.Shared/Services/PropertyInput/PropertyInputViewModel.cs b/src/Avalonia/Artemis.UI.Shared/Services/PropertyInput/PropertyInputViewModel.cs index 0b2e9f253..f36cf3a51 100644 --- a/src/Avalonia/Artemis.UI.Shared/Services/PropertyInput/PropertyInputViewModel.cs +++ b/src/Avalonia/Artemis.UI.Shared/Services/PropertyInput/PropertyInputViewModel.cs @@ -103,6 +103,16 @@ public abstract class PropertyInputViewModel : PropertyInputViewModel } } + /// + /// Gets the prefix to show before input elements + /// + public string? Prefix => LayerProperty.PropertyDescription.InputPrefix; + + /// + /// Gets the affix to show after input elements + /// + public string? Affix => LayerProperty.PropertyDescription.InputAffix; + internal override object InternalGuard { get; } = new(); /// @@ -186,7 +196,6 @@ public abstract class PropertyInputViewModel : PropertyInputViewModel { _updating = false; } - } private void UpdateDataBinding() diff --git a/src/Avalonia/Artemis.UI.Shared/Styles/Artemis.axaml b/src/Avalonia/Artemis.UI.Shared/Styles/Artemis.axaml index 302197215..f77636350 100644 --- a/src/Avalonia/Artemis.UI.Shared/Styles/Artemis.axaml +++ b/src/Avalonia/Artemis.UI.Shared/Styles/Artemis.axaml @@ -28,6 +28,8 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI.Shared/Styles/TextBox.axaml b/src/Avalonia/Artemis.UI.Shared/Styles/TextBox.axaml new file mode 100644 index 000000000..e536cf635 --- /dev/null +++ b/src/Avalonia/Artemis.UI.Shared/Styles/TextBox.axaml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI/Artemis.UI.csproj b/src/Avalonia/Artemis.UI/Artemis.UI.csproj index 21e8cea0e..f3ea192ba 100644 --- a/src/Avalonia/Artemis.UI/Artemis.UI.csproj +++ b/src/Avalonia/Artemis.UI/Artemis.UI.csproj @@ -54,4 +54,7 @@ PropertiesView.axaml + + + \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI/DefaultTypes/DataModel/Display/SKColorDataModelDisplayView.xaml b/src/Avalonia/Artemis.UI/DefaultTypes/DataModel/Display/SKColorDataModelDisplayView.xaml deleted file mode 100644 index e6215d1a6..000000000 --- a/src/Avalonia/Artemis.UI/DefaultTypes/DataModel/Display/SKColorDataModelDisplayView.xaml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI/DefaultTypes/DataModel/Display/SKColorDataModelDisplayViewModel.cs b/src/Avalonia/Artemis.UI/DefaultTypes/DataModel/Display/SKColorDataModelDisplayViewModel.cs deleted file mode 100644 index c08de2224..000000000 --- a/src/Avalonia/Artemis.UI/DefaultTypes/DataModel/Display/SKColorDataModelDisplayViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Artemis.UI.Shared.DataModelVisualization; -using SkiaSharp; - -namespace Artemis.UI.DefaultTypes.DataModel.Display; - -public class SKColorDataModelDisplayViewModel : DataModelDisplayViewModel -{ -} \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI/DefaultTypes/PropertyInput/BoolPropertyInputView.axaml b/src/Avalonia/Artemis.UI/DefaultTypes/PropertyInput/BoolPropertyInputView.axaml index 8452fec0f..8912a6a9b 100644 --- a/src/Avalonia/Artemis.UI/DefaultTypes/PropertyInput/BoolPropertyInputView.axaml +++ b/src/Avalonia/Artemis.UI/DefaultTypes/PropertyInput/BoolPropertyInputView.axaml @@ -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"> - + x:Class="Artemis.UI.DefaultTypes.PropertyInput.BoolPropertyInputView" + x:DataType="propertyInput:BoolPropertyInputViewModel"> + \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI/DefaultTypes/PropertyInput/BrushPropertyInputView.axaml b/src/Avalonia/Artemis.UI/DefaultTypes/PropertyInput/BrushPropertyInputView.axaml index ec3832869..8407e5714 100644 --- a/src/Avalonia/Artemis.UI/DefaultTypes/PropertyInput/BrushPropertyInputView.axaml +++ b/src/Avalonia/Artemis.UI/DefaultTypes/PropertyInput/BrushPropertyInputView.axaml @@ -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"> - - - - - + + + + + - + - + - + - + - + - + - + - + @@ -68,10 +70,10 @@ - - diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/TreeItemViewModel.cs b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/TreeItemViewModel.cs index 7b79ca8b5..b24e33450 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/TreeItemViewModel.cs +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/ProfileTree/TreeItemViewModel.cs @@ -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 AddLayer { get; } public ReactiveCommand AddFolder { get; } public ReactiveCommand Rename { get; } + public ReactiveCommand Duplicate { get; } + public ReactiveCommand Copy { get; } + public ReactiveCommand Paste { get; } public ReactiveCommand Delete { get; } public string? RenameValue diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/PropertiesView.axaml b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/PropertiesView.axaml index 5b694742c..1e2461687 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/PropertiesView.axaml +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/PropertiesView.axaml @@ -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"> @@ -15,22 +16,22 @@ - + - + - + - - + + @@ -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" /> - - + - + + Content="{CompiledBinding TimelineViewModel.StartSegmentViewModel}" /> - diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingView.axaml b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingView.axaml index bcc8e697e..4dace623e 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingView.axaml +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Keyframes/TimelineEasingView.axaml @@ -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"> - + diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/EndSegmentView.axaml b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/EndSegmentView.axaml index bb15969fa..85cd1dcae 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/EndSegmentView.axaml +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/EndSegmentView.axaml @@ -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"> + IsVisible="{CompiledBinding ShowAddMain}"> @@ -50,7 +52,7 @@ PointerPressed="KeyframeDragAnchor_OnPointerPressed" PointerMoved="KeyframeDragAnchor_OnPointerMoved" PointerReleased="KeyframeDragAnchor_OnPointerReleased" - ToolTip.Tip="{Binding EndTimestamp}"/> + ToolTip.Tip="{CompiledBinding EndTimestamp}"/> \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/MainSegmentView.axaml b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/MainSegmentView.axaml index 6efe166ab..9884a7533 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/MainSegmentView.axaml +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/MainSegmentView.axaml @@ -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"> @@ -47,7 +49,7 @@ @@ -59,7 +61,7 @@ VerticalAlignment="Center" ToolTip.Tip="Add an end segment" Command="{Binding AddEndSegment}" - IsVisible="{Binding ShowAddEnd}"> + IsVisible="{CompiledBinding ShowAddEnd}"> @@ -72,7 +74,7 @@ PointerPressed="KeyframeDragAnchor_OnPointerPressed" PointerMoved="KeyframeDragAnchor_OnPointerMoved" PointerReleased="KeyframeDragAnchor_OnPointerReleased" - ToolTip.Tip="{Binding EndTimestamp}"/> + ToolTip.Tip="{CompiledBinding EndTimestamp}"/> \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/MainSegmentViewModel.cs b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/MainSegmentViewModel.cs index bad569d7b..0d3eb4c5a 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/MainSegmentViewModel.cs +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/MainSegmentViewModel.cs @@ -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? _start; private ObservableAsPropertyHelper? _end; private ObservableAsPropertyHelper? _endTimestamp; + private ObservableAsPropertyHelper? _repeatSegment; private readonly ObservableAsPropertyHelper _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()) @@ -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()) + .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(); + } } \ No newline at end of file diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/StartSegmentView.axaml b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/StartSegmentView.axaml index aeaa95f4e..8ec723260 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/StartSegmentView.axaml +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/Segments/StartSegmentView.axaml @@ -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"> @@ -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}"> @@ -47,7 +49,7 @@ PointerPressed="KeyframeDragAnchor_OnPointerPressed" PointerMoved="KeyframeDragAnchor_OnPointerMoved" PointerReleased="KeyframeDragAnchor_OnPointerReleased" - ToolTip.Tip="{Binding EndTimestamp}"/> + ToolTip.Tip="{CompiledBinding EndTimestamp}"/> diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineGroupView.axaml b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineGroupView.axaml index 22bc2b8fb..b63e8f7bb 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineGroupView.axaml +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineGroupView.axaml @@ -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"> - - - - - - + x:Class="Artemis.UI.Screens.ProfileEditor.Properties.Timeline.TimelineGroupView" + x:DataType="timeline:TimelineGroupViewModel"> + @@ -41,15 +38,15 @@ - + - + diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineGroupViewModel.cs b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineGroupViewModel.cs index e6ea9e6d4..a78dace60 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineGroupViewModel.cs +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineGroupViewModel.cs @@ -10,7 +10,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline; public class TimelineGroupViewModel : ActivatableViewModelBase { - private ObservableCollection? _keyframePosition; + private ObservableCollection? _keyframePositions; private int _pixelsPerSecond; public TimelineGroupViewModel(PropertyGroupViewModel propertyGroupViewModel, IProfileEditorService profileEditorService) @@ -33,15 +33,15 @@ public class TimelineGroupViewModel : ActivatableViewModelBase public ObservableCollection? Children => PropertyGroupViewModel.IsExpanded ? PropertyGroupViewModel.Children : null; - public ObservableCollection? KeyframePosition + public ObservableCollection? KeyframePositions { - get => _keyframePosition; - set => this.RaiseAndSetIfChanged(ref _keyframePosition, value); + get => _keyframePositions; + set => this.RaiseAndSetIfChanged(ref _keyframePositions, value); } private void UpdateKeyframePositions() { - KeyframePosition = new ObservableCollection(PropertyGroupViewModel + KeyframePositions = new ObservableCollection(PropertyGroupViewModel .GetAllKeyframeViewModels(false) .Select(p => p.Position.TotalSeconds * _pixelsPerSecond)); } diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineView.axaml b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineView.axaml index 0dbaf8c3b..b01eacb4e 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineView.axaml +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Timeline/TimelineView.axaml @@ -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"> 28 29 @@ -14,14 +16,14 @@ - + - - + + - + diff --git a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/TreePropertyView.axaml b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/TreePropertyView.axaml index edda3d7d9..18b4a529d 100644 --- a/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/TreePropertyView.axaml +++ b/src/Avalonia/Artemis.UI/Screens/ProfileEditor/Panels/Properties/Tree/TreePropertyView.axaml @@ -41,6 +41,7 @@ ToolTip.Tip="{Binding LayerProperty.PropertyDescription.Description}" />