Timeline - Added segment time input

Timeline - Ensure segments can't get too short, prevent removing all segments
This commit is contained in:
Robert committed 2022-07-26 21:26:38 +02:00
1 parent 92ad3eea92
commit 9135128ffd
10 files changed
+181 -15

No files matched your search

@@ -0,0 +1,18 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:dialogs="clr-namespace:Artemis.UI.Screens.ProfileEditor.Properties.Dialogs"
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.ProfileEditor.Properties.Dialogs.TimelineSegmentEditView"
x:DataType="dialogs:TimelineSegmentEditViewModel">
<StackPanel>
<controls:NumberBox Name="LengthNumberBox"
Minimum="0.1"
Value="{CompiledBinding SegmentLength}"
HorizontalAlignment="Stretch"
attachedProperties:NumberBoxAssist.SuffixText="sec"/>
</StackPanel>
</UserControl>
@@ -0,0 +1,19 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Dialogs;
public partial class TimelineSegmentEditView : ReactiveUserControl<TimelineSegmentEditViewModel>
{
public TimelineSegmentEditView()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
@@ -0,0 +1,20 @@
using System;
using Artemis.UI.Shared;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Dialogs;
public class TimelineSegmentEditViewModel : ContentDialogViewModelBase
{
private double _segmentLength;
public TimelineSegmentEditViewModel(TimeSpan segmentLength)
{
SegmentLength = segmentLength.TotalSeconds;
}
public double SegmentLength
{
get => _segmentLength;
set => _segmentLength = value;
}
}