Code cleanup

This commit is contained in:
Robert committed 2020-01-14 17:25:13 +01:00
1 parent c97b479779
commit f071871695
73 files changed
+372 -364

No files matched your search

@@ -14,11 +14,11 @@
d:DataContext="{d:DesignInstance local:LayerPropertiesViewModel}"
behaviors:InputBindingBehavior.PropagateInputBindingsToWindow="True">
<UserControl.InputBindings>
<KeyBinding Command="{s:Action Play}" Key="Space"></KeyBinding>
<KeyBinding Command="{s:Action PlayFromStart}" Modifiers="Shift" Key="Space"></KeyBinding>
<KeyBinding Command="{s:Action Play}" Key="Space" />
<KeyBinding Command="{s:Action PlayFromStart}" Modifiers="Shift" Key="Space" />
</UserControl.InputBindings>
<UserControl.Resources>
<s:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
<s:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</UserControl.Resources>
<Grid x:Name="ContainerGrid">
<Grid.RowDefinitions>
@@ -1,5 +1,4 @@
using System.Windows.Controls;
using System.Windows.Input;
namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
{
@@ -17,13 +16,9 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
private void TimelineScrollChanged(object sender, ScrollChangedEventArgs e)
{
if (sender == TimelineHeaderScrollViewer)
{
TimelineRailsScrollViewer.ScrollToHorizontalOffset(e.HorizontalOffset);
}
else if (sender == TimelineRailsScrollViewer)
{
TimelineHeaderScrollViewer.ScrollToHorizontalOffset(e.HorizontalOffset);
}
}
}
}
@@ -15,7 +15,8 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
private readonly IProfileEditorService _profileEditorService;
private bool _keyframesEnabled;
public LayerPropertyViewModel(BaseLayerProperty layerProperty, LayerPropertyViewModel parent, ILayerPropertyViewModelFactory layerPropertyViewModelFactory, IKernel kernel, IProfileEditorService profileEditorService)
public LayerPropertyViewModel(BaseLayerProperty layerProperty, LayerPropertyViewModel parent, ILayerPropertyViewModelFactory layerPropertyViewModelFactory, IKernel kernel,
IProfileEditorService profileEditorService)
{
_kernel = kernel;
_profileEditorService = profileEditorService;
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.UI.Services.Interfaces;
namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput
@@ -15,7 +15,7 @@
Padding="0 -1"
materialDesign:ValidationAssist.UsePopup="True"
HorizontalAlignment="Left"
Text="{Binding IntInputValue}"/>
Text="{Binding IntInputValue}" />
<TextBlock Margin="5 0 0 0" Width="10" VerticalAlignment="Bottom" Text="{Binding LayerPropertyViewModel.LayerProperty.InputAffix}" />
</StackPanel>
</UserControl>
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.UI.Services.Interfaces;
namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.PropertyInput
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Artemis.UI.Exceptions;
using Artemis.UI.Services.Interfaces;
using Stylet;
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.UI.Services.Interfaces;
using PropertyChanged;
using SkiaSharp;
@@ -26,7 +25,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P
[DependsOn(nameof(InputValue))]
public float Y
{
get => ((SKPoint?)InputValue)?.Y ?? 0;
get => ((SKPoint?) InputValue)?.Y ?? 0;
set => InputValue = new SKPoint(X, value);
}
@@ -16,7 +16,7 @@
materialDesign:ValidationAssist.UsePopup="True"
HorizontalAlignment="Left"
ToolTip="Height"
Text="{Binding Height}"/>
Text="{Binding Height}" />
<TextBlock Margin="5 0" VerticalAlignment="Bottom">,</TextBlock>
<TextBox Width="60"
Margin="0 2"
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Models.Profile.LayerProperties;
using Artemis.UI.Services.Interfaces;
using PropertyChanged;
using SkiaSharp;
@@ -26,7 +25,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.PropertyTree.P
[DependsOn(nameof(InputValue))]
public float Height
{
get => ((SKSize?)InputValue)?.Height ?? 0;
get => ((SKSize?) InputValue)?.Height ?? 0;
set => InputValue = new SKSize(Width, value);
}
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Artemis.UI.Services.Interfaces;
using Stylet;
@@ -74,7 +74,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline
}
/// <summary>
/// Updates the time line's keyframes
/// Updates the time line's keyframes
/// </summary>
public void Update()
{
@@ -18,7 +18,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline
EasingFunction = easingFunction;
Description = easingFunction.Humanize();
CreateGeometry();
}