Fixed compile errors in Artemis.UI

This commit is contained in:
Robert committed 2023-03-30 23:13:39 +02:00
1 parent 81e83e59f6
commit d171b947b7
160 files changed
+407 -521

No files matched your search

@@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.DataBinding;
public class DataBindingView : ReactiveUserControl<DataBindingViewModel>
public partial class DataBindingView : ReactiveUserControl<DataBindingViewModel>
{
public DataBindingView()
{
@@ -6,7 +6,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Dialogs;
public class AddEffectView : ReactiveUserControl<AddEffectViewModel>
public partial class AddEffectView : ReactiveUserControl<AddEffectViewModel>
{
public AddEffectView()
{
@@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Dialogs;
public class TimelineSegmentEditView : ReactiveUserControl<TimelineSegmentEditViewModel>
public partial class TimelineSegmentEditView : ReactiveUserControl<TimelineSegmentEditViewModel>
{
public TimelineSegmentEditView()
{
@@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
@@ -10,16 +9,11 @@ using Avalonia.VisualTree;
namespace Artemis.UI.Screens.ProfileEditor.Properties;
public class PropertiesView : ReactiveUserControl<PropertiesViewModel>
public partial class PropertiesView : ReactiveUserControl<PropertiesViewModel>
{
private readonly Polygon _timelineCaret;
private readonly Line _timelineLine;
public PropertiesView()
{
InitializeComponent();
_timelineCaret = this.Get<Polygon>("TimelineCaret");
_timelineLine = this.Get<Line>("TimelineLine");
}
private void InitializeComponent()
@@ -58,12 +52,12 @@ public class PropertiesView : ReactiveUserControl<PropertiesViewModel>
if (!e.GetCurrentPoint(this).Properties.IsLeftButtonPressed || ViewModel == null)
return;
IInputElement? senderElement = (IInputElement?) sender;
Visual? senderElement = (Visual?) sender;
if (senderElement == null)
return;
// Get the parent grid, need that for our position
IVisual? parent = senderElement.VisualParent;
Visual? parent = senderElement.GetVisualParent();
double x = Math.Max(0, e.GetPosition(parent).X);
TimeSpan newTime = TimeSpan.FromSeconds(x / ViewModel.PixelsPerSecond);
newTime = RoundTime(newTime);
@@ -84,11 +78,11 @@ public class PropertiesView : ReactiveUserControl<PropertiesViewModel>
private void TimelineHeader_OnPointerReleased(object? sender, PointerReleasedEventArgs e)
{
if (ViewModel == null || sender is not IInputElement senderElement)
if (ViewModel == null || sender is not Visual senderElement)
return;
// Get the parent grid, need that for our position
double x = Math.Max(0, e.GetPosition(senderElement.VisualParent).X);
double x = Math.Max(0, e.GetPosition(senderElement.GetVisualParent()).X);
TimeSpan newTime = TimeSpan.FromSeconds(x / ViewModel.PixelsPerSecond);
ViewModel.TimelineViewModel.ChangeTime(RoundTime(newTime));
@@ -3,7 +3,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes;
public class TimelineEasingView : UserControl
public partial class TimelineEasingView : UserControl
{
public TimelineEasingView()
{
@@ -6,7 +6,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes;
public class TimelineKeyframeView : ReactiveUserControl<ITimelineKeyframeViewModel>
public partial class TimelineKeyframeView : ReactiveUserControl<ITimelineKeyframeViewModel>
{
private bool _moved;
private TimelinePropertyView? _timelinePropertyView;
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
using Artemis.Core;
@@ -13,7 +14,6 @@ using Artemis.UI.Shared.Extensions;
using Artemis.UI.Shared.Services.ProfileEditor;
using Artemis.UI.Shared.Services.ProfileEditor.Commands;
using Avalonia;
using Avalonia.Controls.Mixins;
using Avalonia.Input;
using DynamicData;
using DynamicData.Binding;
@@ -6,15 +6,13 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments;
public class EndSegmentView : ReactiveUserControl<EndSegmentViewModel>
public partial class EndSegmentView : ReactiveUserControl<EndSegmentViewModel>
{
private readonly Rectangle _keyframeDragAnchor;
private double _dragOffset;
public EndSegmentView()
{
InitializeComponent();
_keyframeDragAnchor = this.Get<Rectangle>("KeyframeDragAnchor");
}
private void InitializeComponent()
@@ -26,7 +24,7 @@ public class EndSegmentView : ReactiveUserControl<EndSegmentViewModel>
{
if (ViewModel == null || !e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
return;
e.Pointer.Capture(_keyframeDragAnchor);
e.Pointer.Capture(KeyframeDragAnchor);
_dragOffset = ViewModel.Width - e.GetCurrentPoint(this).Position.X;
ViewModel.StartResize();
@@ -34,14 +32,14 @@ public class EndSegmentView : ReactiveUserControl<EndSegmentViewModel>
private void KeyframeDragAnchor_OnPointerMoved(object? sender, PointerEventArgs e)
{
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, _keyframeDragAnchor))
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, KeyframeDragAnchor))
return;
ViewModel.UpdateResize(e.GetCurrentPoint(this).Position.X + _dragOffset, e.KeyModifiers.HasFlag(KeyModifiers.Shift), e.KeyModifiers.HasFlag(KeyModifiers.Control));
}
private void KeyframeDragAnchor_OnPointerReleased(object? sender, PointerReleasedEventArgs e)
{
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, _keyframeDragAnchor))
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, KeyframeDragAnchor))
return;
e.Pointer.Capture(null);
ViewModel.FinishResize(e.GetCurrentPoint(this).Position.X + _dragOffset, e.KeyModifiers.HasFlag(KeyModifiers.Shift), e.KeyModifiers.HasFlag(KeyModifiers.Control));
@@ -1,10 +1,10 @@
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Shared.Services;
using Artemis.UI.Shared.Services.ProfileEditor;
using Artemis.UI.Shared.Services.ProfileEditor.Commands;
using Avalonia.Controls.Mixins;
using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments;
@@ -6,15 +6,13 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments;
public class MainSegmentView : ReactiveUserControl<MainSegmentViewModel>
public partial class MainSegmentView : ReactiveUserControl<MainSegmentViewModel>
{
private readonly Rectangle _keyframeDragAnchor;
private double _dragOffset;
public MainSegmentView()
{
InitializeComponent();
_keyframeDragAnchor = this.Get<Rectangle>("KeyframeDragAnchor");
}
private void InitializeComponent()
@@ -26,7 +24,7 @@ public class MainSegmentView : ReactiveUserControl<MainSegmentViewModel>
{
if (ViewModel == null || !e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
return;
e.Pointer.Capture(_keyframeDragAnchor);
e.Pointer.Capture(KeyframeDragAnchor);
_dragOffset = ViewModel.Width - e.GetCurrentPoint(this).Position.X;
ViewModel.StartResize();
@@ -34,14 +32,14 @@ public class MainSegmentView : ReactiveUserControl<MainSegmentViewModel>
private void KeyframeDragAnchor_OnPointerMoved(object? sender, PointerEventArgs e)
{
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, _keyframeDragAnchor))
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, KeyframeDragAnchor))
return;
ViewModel.UpdateResize(e.GetCurrentPoint(this).Position.X + _dragOffset, e.KeyModifiers.HasFlag(KeyModifiers.Shift), e.KeyModifiers.HasFlag(KeyModifiers.Control));
}
private void KeyframeDragAnchor_OnPointerReleased(object? sender, PointerReleasedEventArgs e)
{
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, _keyframeDragAnchor))
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, KeyframeDragAnchor))
return;
e.Pointer.Capture(null);
ViewModel.FinishResize(e.GetCurrentPoint(this).Position.X + _dragOffset, e.KeyModifiers.HasFlag(KeyModifiers.Shift), e.KeyModifiers.HasFlag(KeyModifiers.Control));
@@ -1,10 +1,10 @@
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Shared.Services;
using Artemis.UI.Shared.Services.ProfileEditor;
using Artemis.UI.Shared.Services.ProfileEditor.Commands;
using Avalonia.Controls.Mixins;
using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments;
@@ -6,15 +6,13 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Segments;
public class StartSegmentView : ReactiveUserControl<StartSegmentViewModel>
public partial class StartSegmentView : ReactiveUserControl<StartSegmentViewModel>
{
private readonly Rectangle _keyframeDragAnchor;
private double _dragOffset;
public StartSegmentView()
{
InitializeComponent();
_keyframeDragAnchor = this.Get<Rectangle>("KeyframeDragAnchor");
}
private void InitializeComponent()
@@ -26,7 +24,7 @@ public class StartSegmentView : ReactiveUserControl<StartSegmentViewModel>
{
if (ViewModel == null || !e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
return;
e.Pointer.Capture(_keyframeDragAnchor);
e.Pointer.Capture(KeyframeDragAnchor);
_dragOffset = ViewModel.Width - e.GetCurrentPoint(this).Position.X;
ViewModel.StartResize();
@@ -34,14 +32,14 @@ public class StartSegmentView : ReactiveUserControl<StartSegmentViewModel>
private void KeyframeDragAnchor_OnPointerMoved(object? sender, PointerEventArgs e)
{
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, _keyframeDragAnchor))
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, KeyframeDragAnchor))
return;
ViewModel.UpdateResize(e.GetCurrentPoint(this).Position.X + _dragOffset, e.KeyModifiers.HasFlag(KeyModifiers.Shift), e.KeyModifiers.HasFlag(KeyModifiers.Control));
}
private void KeyframeDragAnchor_OnPointerReleased(object? sender, PointerReleasedEventArgs e)
{
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, _keyframeDragAnchor))
if (ViewModel == null || !ReferenceEquals(e.Pointer.Captured, KeyframeDragAnchor))
return;
e.Pointer.Capture(null);
ViewModel.FinishResize(e.GetCurrentPoint(this).Position.X + _dragOffset, e.KeyModifiers.HasFlag(KeyModifiers.Shift), e.KeyModifiers.HasFlag(KeyModifiers.Control));
@@ -1,4 +1,5 @@
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Shared.Services;
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
using Artemis.Core;
@@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline;
public class TimelineGroupView : ReactiveUserControl<TimelineGroupViewModel>
public partial class TimelineGroupView : ReactiveUserControl<TimelineGroupViewModel>
{
public TimelineGroupView()
{
@@ -1,8 +1,8 @@
using System;
using System.Collections.ObjectModel;
using System.Reactive.Disposables;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.ProfileEditor;
using Avalonia.Controls.Mixins;
using DynamicData;
using DynamicData.Binding;
using ReactiveUI;
@@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline;
public class TimelinePropertyView : ReactiveUserControl<ITimelinePropertyViewModel>
public partial class TimelinePropertyView : ReactiveUserControl<ITimelinePropertyViewModel>
{
public TimelinePropertyView()
{
@@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Screens.ProfileEditor.Properties.Timeline.Keyframes;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.ProfileEditor;
using Avalonia.Controls.Mixins;
using DynamicData;
using ReactiveUI;
@@ -9,17 +9,15 @@ using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
using Avalonia.VisualTree;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline;
public class TimelineView : ReactiveUserControl<TimelineViewModel>
public partial class TimelineView : ReactiveUserControl<TimelineViewModel>
{
private readonly SelectionRectangle _selectionRectangle;
public TimelineView()
{
InitializeComponent();
_selectionRectangle = this.Get<SelectionRectangle>("SelectionRectangle");
}
private void InitializeComponent()
@@ -34,7 +32,8 @@ public class TimelineView : ReactiveUserControl<TimelineViewModel>
List<TimelineKeyframeView> keyframeViews = this.GetVisualChildrenOfType<TimelineKeyframeView>().Where(k =>
{
Rect hitTestRect = k.TransformedBounds != null ? k.TransformedBounds.Value.Bounds.TransformToAABB(k.TransformedBounds.Value.Transform) : Rect.Empty;
TransformedBounds? transformedBounds = k.GetTransformedBounds();
Rect hitTestRect = transformedBounds != null ? transformedBounds.Value.Bounds.TransformToAABB(transformedBounds.Value.Transform) : new Rect();
return e.AbsoluteRectangle.Intersects(hitTestRect);
}).ToList();
@@ -43,7 +42,7 @@ public class TimelineView : ReactiveUserControl<TimelineViewModel>
private void InputElement_OnPointerReleased(object? sender, PointerReleasedEventArgs e)
{
if (_selectionRectangle.IsSelecting)
if (SelectionRectangle.IsSelecting)
return;
ViewModel?.SelectKeyframes(new List<ITimelineKeyframeViewModel>(), false);
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Threading.Tasks;
using Artemis.Core;
@@ -14,7 +15,6 @@ using Artemis.UI.Shared;
using Artemis.UI.Shared.Extensions;
using Artemis.UI.Shared.Services.ProfileEditor;
using Avalonia;
using Avalonia.Controls.Mixins;
using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Timeline;
@@ -1,6 +1,5 @@
using System.Threading.Tasks;
using Artemis.UI.Shared.Extensions;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
using Avalonia.Threading;
@@ -8,7 +7,7 @@ using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Tree.ContentDialogs;
public class LayerEffectRenameView : ReactiveUserControl<LayerEffectRenameViewModel>
public partial class LayerEffectRenameView : ReactiveUserControl<LayerEffectRenameViewModel>
{
public LayerEffectRenameView()
{
@@ -24,8 +23,8 @@ public class LayerEffectRenameView : ReactiveUserControl<LayerEffectRenameViewMo
{
// Don't ask
await Task.Delay(200);
this.Get<TextBox>("NameTextBox").SelectAll();
this.Get<TextBox>("NameTextBox").Focus();
NameTextBox.SelectAll();
NameTextBox.Focus();
}
private void InitializeComponent()
@@ -6,7 +6,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Tree.Dialogs;
public class LayerBrushPresetView : ReactiveUserControl<LayerBrushPresetViewModel>
public partial class LayerBrushPresetView : ReactiveUserControl<LayerBrushPresetViewModel>
{
public LayerBrushPresetView()
{
@@ -4,7 +4,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Tree;
public class TreeGroupView : ReactiveUserControl<TreeGroupViewModel>
public partial class TreeGroupView : ReactiveUserControl<TreeGroupViewModel>
{
public TreeGroupView()
{
@@ -1,9 +1,8 @@
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Avalonia.Controls;
using Avalonia.Controls.Mixins;
using Avalonia.Controls.Primitives;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
@@ -11,7 +10,7 @@ using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Tree;
public class TreePropertyView : ReactiveUserControl<ITreePropertyViewModel>
public partial class TreePropertyView : ReactiveUserControl<ITreePropertyViewModel>
{
public TreePropertyView()
{
@@ -32,6 +31,6 @@ public class TreePropertyView : ReactiveUserControl<ITreePropertyViewModel>
private void DataBindingToggleButton_OnClick(object? sender, RoutedEventArgs e)
{
ViewModel?.ToggleCurrentLayerProperty();
this.Find<ToggleButton>("DataBindingToggleButton").IsChecked = !this.Find<ToggleButton>("DataBindingToggleButton").IsChecked;
DataBindingToggleButton.IsChecked = !DataBindingToggleButton.IsChecked;
}
}
@@ -1,5 +1,6 @@
using System;
using System.Reactive;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using Artemis.Core;
using Artemis.UI.Extensions;
@@ -7,7 +8,6 @@ using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.ProfileEditor;
using Artemis.UI.Shared.Services.ProfileEditor.Commands;
using Artemis.UI.Shared.Services.PropertyInput;
using Avalonia.Controls.Mixins;
using ReactiveUI;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Tree;
@@ -1,8 +1,8 @@
<controls:CoreWindow xmlns="https://github.com/avaloniaui"
<windowing:AppWindow 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:windowing="clr-namespace:FluentAvalonia.UI.Windowing;assembly=FluentAvalonia"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
@@ -15,4 +15,4 @@
<Panel>
<ContentControl Content="{Binding ConfigurationViewModel}" />
</Panel>
</controls:CoreWindow>
</windowing:AppWindow>
@@ -5,7 +5,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Windows;
public class BrushConfigurationWindowView : ReactiveAppWindow<BrushConfigurationWindowViewModel>
public partial class BrushConfigurationWindowView : ReactiveAppWindow<BrushConfigurationWindowViewModel>
{
private bool _canClose;
@@ -1,8 +1,8 @@
<controls:CoreWindow xmlns="https://github.com/avaloniaui"
<windowing:AppWindow 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:windowing="clr-namespace:FluentAvalonia.UI.Windowing;assembly=FluentAvalonia"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
@@ -15,4 +15,4 @@
<Panel>
<ContentControl Content="{Binding ConfigurationViewModel}" />
</Panel>
</controls:CoreWindow>
</windowing:AppWindow>
@@ -5,7 +5,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Windows;
public class EffectConfigurationWindowView : ReactiveAppWindow<EffectConfigurationWindowViewModel>
public partial class EffectConfigurationWindowView : ReactiveAppWindow<EffectConfigurationWindowViewModel>
{
private bool _canClose;