1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Fixed Artemis.UI.Shared compile errors

This commit is contained in:
Robert 2023-03-29 21:36:56 +02:00
parent 1d6a30c447
commit 81e83e59f6
61 changed files with 343 additions and 1746 deletions

View File

@ -39,6 +39,7 @@
<PackageReference Include="EmbedIO" Version="3.5.0" /> <PackageReference Include="EmbedIO" Version="3.5.0" />
<PackageReference Include="HidSharp" Version="2.1.0" /> <PackageReference Include="HidSharp" Version="2.1.0" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" /> <PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="JetBrains.Annotations" Version="2022.3.1" />
<PackageReference Include="LiteDB" Version="5.0.12" /> <PackageReference Include="LiteDB" Version="5.0.12" />
<PackageReference Include="McMaster.NETCore.Plugins" Version="1.4.0" /> <PackageReference Include="McMaster.NETCore.Plugins" Version="1.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
@ -49,7 +50,7 @@
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" /> <PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" /> <PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" /> <PackageReference Include="SkiaSharp" Version="2.88.3" />
<PackageReference Include="System.Buffers" Version="4.5.1" /> <PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" /> <PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" /> <PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />

File diff suppressed because it is too large Load Diff

View File

@ -16,12 +16,12 @@
<None Remove=".gitignore" /> <None Remove=".gitignore" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" /> <PackageReference Include="Avalonia" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" /> <PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview6" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview6" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />

View File

@ -15,12 +15,12 @@
<None Remove=".gitignore" /> <None Remove=".gitignore" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" /> <PackageReference Include="Avalonia" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" /> <PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview6" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview6" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />

View File

@ -10,18 +10,18 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" /> <PackageReference Include="Avalonia" Version="11.0.0-preview6" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.18" /> <PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview6" />
<PackageReference Include="DynamicData" Version="7.9.14" /> <PackageReference Include="DynamicData" Version="7.13.1" />
<PackageReference Include="FluentAvaloniaUI" Version="1.4.1" /> <PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview6" />
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" /> <PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />
<PackageReference Include="RGB.NET.Core" Version="2.0.0-prerelease.17" /> <PackageReference Include="RGB.NET.Core" Version="2.0.0-prerelease.17" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" /> <PackageReference Include="SkiaSharp" Version="2.88.3" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />

View File

@ -15,7 +15,7 @@ public class LostFocusNumericUpDownBindingBehavior : Behavior<NumericUpDown>
/// <summary> /// <summary>
/// Gets or sets the value of the binding. /// Gets or sets the value of the binding.
/// </summary> /// </summary>
public static readonly StyledProperty<double> ValueProperty = AvaloniaProperty.Register<LostFocusNumericUpDownBindingBehavior, double>( public static readonly StyledProperty<decimal?> ValueProperty = AvaloniaProperty.Register<LostFocusNumericUpDownBindingBehavior, decimal?>(
nameof(Value), defaultBindingMode: BindingMode.TwoWay); nameof(Value), defaultBindingMode: BindingMode.TwoWay);
static LostFocusNumericUpDownBindingBehavior() static LostFocusNumericUpDownBindingBehavior()
@ -26,7 +26,7 @@ public class LostFocusNumericUpDownBindingBehavior : Behavior<NumericUpDown>
/// <summary> /// <summary>
/// Gets or sets the value of the binding. /// Gets or sets the value of the binding.
/// </summary> /// </summary>
public double Value public decimal? Value
{ {
get => GetValue(ValueProperty); get => GetValue(ValueProperty);
set => SetValue(ValueProperty, value); set => SetValue(ValueProperty, value);

View File

@ -2,12 +2,12 @@ using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Documents;
using Avalonia.Layout; using Avalonia.Layout;
using Avalonia.LogicalTree; using Avalonia.LogicalTree;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
using Avalonia.Visuals.Media.Imaging;
using Material.Icons; using Material.Icons;
using Material.Icons.Avalonia; using Material.Icons.Avalonia;
@ -16,9 +16,9 @@ namespace Artemis.UI.Shared;
/// <summary> /// <summary>
/// Represents a control that can display an arbitrary kind of icon. /// Represents a control that can display an arbitrary kind of icon.
/// </summary> /// </summary>
public class ArtemisIcon : UserControl public partial class ArtemisIcon : UserControl
{ {
private static readonly Regex _imageRegex = new(@"[\/.](gif|jpg|jpeg|tiff|png)$", RegexOptions.Compiled); private static readonly Regex ImageRegex = new(@"[\/.](gif|jpg|jpeg|tiff|png)$", RegexOptions.Compiled);
/// <summary> /// <summary>
/// Creates a new instance of the <see cref="ArtemisIcon" /> class. /// Creates a new instance of the <see cref="ArtemisIcon" /> class.
@ -30,12 +30,6 @@ public class ArtemisIcon : UserControl
LayoutUpdated += OnLayoutUpdated; LayoutUpdated += OnLayoutUpdated;
} }
private static void IconChanging(IAvaloniaObject sender, bool before)
{
if (before)
((ArtemisIcon) sender).Update();
}
private void Update() private void Update()
{ {
try try
@ -54,7 +48,7 @@ public class ArtemisIcon : UserControl
Content = new MaterialIcon {Kind = parsedIcon, Width = Bounds.Width, Height = Bounds.Height}; Content = new MaterialIcon {Kind = parsedIcon, Width = Bounds.Width, Height = Bounds.Height};
} }
// An URI pointing to an image // An URI pointing to an image
else if (_imageRegex.IsMatch(iconString)) else if (ImageRegex.IsMatch(iconString))
{ {
if (!Fill) if (!Fill)
Content = new Image Content = new Image
@ -66,7 +60,7 @@ public class ArtemisIcon : UserControl
else else
Content = new Border Content = new Border
{ {
Background = TextBlock.GetForeground(this), Background = TextElement.GetForeground(this),
VerticalAlignment = VerticalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch,
HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalAlignment = HorizontalAlignment.Stretch,
OpacityMask = new ImageBrush(new Bitmap(iconString)) {BitmapInterpolationMode = BitmapInterpolationMode.MediumQuality} OpacityMask = new ImageBrush(new Bitmap(iconString)) {BitmapInterpolationMode = BitmapInterpolationMode.MediumQuality}
@ -110,8 +104,7 @@ public class ArtemisIcon : UserControl
/// Gets or sets the currently displayed icon as either a <see cref="MaterialIconKind" /> or an <see cref="Uri" /> /// Gets or sets the currently displayed icon as either a <see cref="MaterialIconKind" /> or an <see cref="Uri" />
/// pointing to an SVG /// pointing to an SVG
/// </summary> /// </summary>
public static readonly StyledProperty<object?> IconProperty = public static readonly StyledProperty<object?> IconProperty = AvaloniaProperty.Register<ArtemisIcon, object?>(nameof(Icon));
AvaloniaProperty.Register<ArtemisIcon, object?>(nameof(Icon), notifying: IconChanging);
/// <summary> /// <summary>
@ -121,15 +114,18 @@ public class ArtemisIcon : UserControl
public object? Icon public object? Icon
{ {
get => GetValue(IconProperty); get => GetValue(IconProperty);
set => SetValue(IconProperty, value); set
{
SetValue(IconProperty, value);
Update();
}
} }
/// <summary> /// <summary>
/// Gets or sets a boolean indicating whether or not the icon should be filled in with the primary text color of the /// Gets or sets a boolean indicating whether or not the icon should be filled in with the primary text color of the
/// theme /// theme
/// </summary> /// </summary>
public static readonly StyledProperty<bool> FillProperty = public static readonly StyledProperty<bool> FillProperty = AvaloniaProperty.Register<ArtemisIcon, bool>(nameof(Icon));
AvaloniaProperty.Register<ArtemisIcon, bool>(nameof(Icon), false, notifying: IconChanging);
/// <summary> /// <summary>
/// Gets or sets a boolean indicating whether or not the icon should be filled in with the primary text color of the /// Gets or sets a boolean indicating whether or not the icon should be filled in with the primary text color of the
@ -138,7 +134,11 @@ public class ArtemisIcon : UserControl
public bool Fill public bool Fill
{ {
get => GetValue(FillProperty); get => GetValue(FillProperty);
set => SetValue(FillProperty, value); set
{
SetValue(FillProperty, value);
Update();
}
} }
#endregion #endregion

View File

@ -46,8 +46,8 @@ public class DataModelPickerButton : TemplatedControl
/// <summary> /// <summary>
/// Gets or sets the desired flyout placement. /// Gets or sets the desired flyout placement.
/// </summary> /// </summary>
public static readonly StyledProperty<FlyoutPlacementMode> PlacementProperty = public static readonly StyledProperty<PlacementMode> PlacementProperty =
AvaloniaProperty.Register<FlyoutBase, FlyoutPlacementMode>(nameof(Placement)); AvaloniaProperty.Register<FlyoutBase, PlacementMode>(nameof(Placement));
/// <summary> /// <summary>
/// Gets or sets data model path. /// Gets or sets data model path.
@ -133,7 +133,7 @@ public class DataModelPickerButton : TemplatedControl
/// <summary> /// <summary>
/// Gets or sets the desired flyout placement. /// Gets or sets the desired flyout placement.
/// </summary> /// </summary>
public FlyoutPlacementMode Placement public PlacementMode Placement
{ {
get => GetValue(PlacementProperty); get => GetValue(PlacementProperty);
set => SetValue(PlacementProperty, value); set => SetValue(PlacementProperty, value);

View File

@ -15,7 +15,6 @@ using Avalonia.Media.Imaging;
using Avalonia.Platform; using Avalonia.Platform;
using Avalonia.Rendering; using Avalonia.Rendering;
using Avalonia.Threading; using Avalonia.Threading;
using Avalonia.Visuals.Media.Imaging;
namespace Artemis.UI.Shared; namespace Artemis.UI.Shared;
@ -123,7 +122,7 @@ public class DeviceVisualizer : Control
private Rect MeasureDevice() private Rect MeasureDevice()
{ {
if (Device == null) if (Device == null)
return Rect.Empty; return new Rect(0, 0, 0, 0);
Rect deviceRect = new(0, 0, Device.RgbDevice.ActualSize.Width, Device.RgbDevice.ActualSize.Height); Rect deviceRect = new(0, 0, Device.RgbDevice.ActualSize.Width, Device.RgbDevice.ActualSize.Height);
Geometry geometry = new RectangleGeometry(deviceRect); Geometry geometry = new RectangleGeometry(deviceRect);
@ -171,21 +170,19 @@ public class DeviceVisualizer : Control
/// Gets or sets the <see cref="ArtemisDevice" /> to display /// Gets or sets the <see cref="ArtemisDevice" /> to display
/// </summary> /// </summary>
public static readonly StyledProperty<ArtemisDevice?> DeviceProperty = public static readonly StyledProperty<ArtemisDevice?> DeviceProperty =
AvaloniaProperty.Register<DeviceVisualizer, ArtemisDevice?>(nameof(Device), notifying: DeviceUpdated); AvaloniaProperty.Register<DeviceVisualizer, ArtemisDevice?>(nameof(Device));
private static void DeviceUpdated(IAvaloniaObject sender, bool before)
{
if (!before)
((DeviceVisualizer) sender).SetupForDevice();
}
/// <summary> /// <summary>
/// Gets or sets the <see cref="ArtemisDevice" /> to display /// Gets or sets the <see cref="ArtemisDevice" /> to display
/// </summary> /// </summary>
public ArtemisDevice? Device public ArtemisDevice? Device
{ {
get => GetValue(DeviceProperty); get => GetValue(DeviceProperty);
set => SetValue(DeviceProperty, value); set
{
SetValue(DeviceProperty, value);
SetupForDevice();
}
} }
/// <summary> /// <summary>
@ -302,9 +299,9 @@ public class DeviceVisualizer : Control
// Render 4 times the actual size of the device to make sure things look sharp when zoomed in // Render 4 times the actual size of the device to make sure things look sharp when zoomed in
RenderTargetBitmap renderTargetBitmap = new(new PixelSize((int) device.RgbDevice.ActualSize.Width * 2, (int) device.RgbDevice.ActualSize.Height * 2)); RenderTargetBitmap renderTargetBitmap = new(new PixelSize((int) device.RgbDevice.ActualSize.Width * 2, (int) device.RgbDevice.ActualSize.Height * 2));
using IDrawingContextImpl context = renderTargetBitmap.CreateDrawingContext(new ImmediateRenderer(this)); using DrawingContext context = renderTargetBitmap.CreateDrawingContext();
using Bitmap bitmap = new(device.Layout.Image.LocalPath); using Bitmap bitmap = new(device.Layout.Image.LocalPath);
context.DrawBitmap(bitmap.PlatformImpl, 1, new Rect(bitmap.Size), new Rect(renderTargetBitmap.Size), BitmapInterpolationMode.HighQuality); context.DrawImage(bitmap, new Rect(bitmap.Size), new Rect(renderTargetBitmap.Size), BitmapInterpolationMode.HighQuality);
lock (_deviceVisualizerLeds) lock (_deviceVisualizerLeds)
{ {

View File

@ -4,8 +4,6 @@ using Artemis.Core;
using Avalonia; using Avalonia;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
using Avalonia.Platform;
using Avalonia.Visuals.Media.Imaging;
using RGB.NET.Core; using RGB.NET.Core;
using Color = Avalonia.Media.Color; using Color = Avalonia.Media.Color;
using Point = Avalonia.Point; using Point = Avalonia.Point;
@ -40,7 +38,7 @@ internal class DeviceVisualizerLed
public Rect LedRect { get; set; } public Rect LedRect { get; set; }
public Geometry? DisplayGeometry { get; private set; } public Geometry? DisplayGeometry { get; private set; }
public void DrawBitmap(IDrawingContextImpl drawingContext, double scale) public void DrawBitmap(DrawingContext drawingContext, double scale)
{ {
if (Led.Layout?.Image == null || !File.Exists(Led.Layout.Image.LocalPath)) if (Led.Layout?.Image == null || !File.Exists(Led.Layout.Image.LocalPath))
return; return;
@ -48,9 +46,8 @@ internal class DeviceVisualizerLed
try try
{ {
using Bitmap bitmap = new(Led.Layout.Image.LocalPath); using Bitmap bitmap = new(Led.Layout.Image.LocalPath);
drawingContext.DrawBitmap( drawingContext.DrawImage(
bitmap.PlatformImpl, bitmap,
1,
new Rect(bitmap.Size), new Rect(bitmap.Size),
new Rect(Led.RgbLed.Location.X * scale, Led.RgbLed.Location.Y * scale, Led.RgbLed.Size.Width * scale, Led.RgbLed.Size.Height * scale), new Rect(Led.RgbLed.Location.X * scale, Led.RgbLed.Location.Y * scale, Led.RgbLed.Size.Width * scale, Led.RgbLed.Size.Height * scale),
BitmapInterpolationMode.HighQuality BitmapInterpolationMode.HighQuality

View File

@ -14,12 +14,12 @@ namespace Artemis.UI.Shared.Controls;
/// <summary> /// <summary>
/// Represents a number box that can be mutated by dragging over it horizontally /// Represents a number box that can be mutated by dragging over it horizontally
/// </summary> /// </summary>
public class DraggableNumberBox : UserControl public partial class DraggableNumberBox : UserControl
{ {
/// <summary> /// <summary>
/// Defines the <see cref="Value" /> property. /// Defines the <see cref="Value" /> property.
/// </summary> /// </summary>
public static readonly StyledProperty<double> ValueProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Value), defaultBindingMode: BindingMode.TwoWay, notifying: ValueChanged); public static readonly StyledProperty<double> ValueProperty = AvaloniaProperty.Register<DraggableNumberBox, double>(nameof(Value), defaultBindingMode: BindingMode.TwoWay);
/// <summary> /// <summary>
/// Defines the <see cref="Minimum" /> property. /// Defines the <see cref="Minimum" /> property.
@ -85,7 +85,11 @@ public class DraggableNumberBox : UserControl
public double Value public double Value
{ {
get => GetValue(ValueProperty); get => GetValue(ValueProperty);
set => SetValue(ValueProperty, value); set
{
SetValue(ValueProperty, value);
SetNumberBoxValue(value);
}
} }
/// <summary> /// <summary>
@ -160,25 +164,21 @@ public class DraggableNumberBox : UserControl
/// Occurs when the user finishes dragging over the control. /// Occurs when the user finishes dragging over the control.
/// </summary> /// </summary>
public event TypedEventHandler<DraggableNumberBox, EventArgs>? DragFinished; public event TypedEventHandler<DraggableNumberBox, EventArgs>? DragFinished;
private static void ValueChanged(IAvaloniaObject sender, bool before) private void SetNumberBoxValue(double value)
{ {
if (before) if (!(Math.Abs(_numberBox.Value - Value) > 0.00001))
return; return;
DraggableNumberBox draggable = (DraggableNumberBox) sender; _updating = true;
if (!(Math.Abs(draggable._numberBox.Value - draggable.Value) > 0.00001)) _numberBox.Value = Value;
return; _updating = false;
draggable._updating = true;
draggable._numberBox.Value = draggable.Value;
draggable._updating = false;
} }
private void HandleKeyUp(object? sender, KeyEventArgs e) private void HandleKeyUp(object? sender, KeyEventArgs e)
{ {
if (e.Key == Key.Enter || e.Key == Key.Escape) if (e.Key == Key.Enter || e.Key == Key.Escape)
Parent?.Focus(); FocusManager.Instance?.Focus(Parent as IInputElement);
} }
private void InitializeComponent() private void InitializeComponent()
@ -211,7 +211,7 @@ public class DraggableNumberBox : UserControl
if (!_moved) if (!_moved)
{ {
// Let our parent take focus, it would make more sense to take focus ourselves but that hides the collider // Let our parent take focus, it would make more sense to take focus ourselves but that hides the collider
Parent?.Focus(); FocusManager.Instance?.Focus(Parent as IInputElement);
_moved = true; _moved = true;
e.Pointer.Capture(this); e.Pointer.Capture(this);
DragStarted?.Invoke(this, EventArgs.Empty); DragStarted?.Invoke(this, EventArgs.Empty);

View File

@ -13,13 +13,12 @@ namespace Artemis.UI.Shared;
/// <summary> /// <summary>
/// Represents a combobox that can display the values of an enum. /// Represents a combobox that can display the values of an enum.
/// </summary> /// </summary>
public class EnumComboBox : UserControl public partial class EnumComboBox : UserControl
{ {
/// <summary> /// <summary>
/// Gets or sets the currently selected value /// Gets or sets the currently selected value
/// </summary> /// </summary>
public static readonly StyledProperty<object?> ValueProperty = public static readonly StyledProperty<object?> ValueProperty = AvaloniaProperty.Register<EnumComboBox, object?>(nameof(Value), defaultBindingMode: BindingMode.TwoWay);
AvaloniaProperty.Register<EnumComboBox, object?>(nameof(Value), defaultBindingMode: BindingMode.TwoWay, notifying: ValueChanged);
private readonly ObservableCollection<(Enum, string)> _currentValues = new(); private readonly ObservableCollection<(Enum, string)> _currentValues = new();
private Type? _currentType; private Type? _currentType;
@ -40,15 +39,11 @@ public class EnumComboBox : UserControl
public object? Value public object? Value
{ {
get => GetValue(ValueProperty); get => GetValue(ValueProperty);
set => SetValue(ValueProperty, value); set
}
private static void ValueChanged(IAvaloniaObject sender, bool before)
{
if (sender is EnumComboBox enumCombo && !before)
{ {
enumCombo.UpdateValues(); SetValue(ValueProperty, value);
enumCombo.UpdateSelection(); UpdateValues();
UpdateSelection();
} }
} }

View File

@ -27,7 +27,7 @@ public class GradientPicker : TemplatedControl
/// Gets or sets the color gradient. /// Gets or sets the color gradient.
/// </summary> /// </summary>
public static readonly StyledProperty<ColorGradient> ColorGradientProperty = public static readonly StyledProperty<ColorGradient> ColorGradientProperty =
AvaloniaProperty.Register<GradientPicker, ColorGradient>(nameof(ColorGradient), notifying: ColorGradientChanged, defaultValue: ColorGradient.GetUnicornBarf()); AvaloniaProperty.Register<GradientPicker, ColorGradient>(nameof(ColorGradient), defaultValue: ColorGradient.GetUnicornBarf());
/// <summary> /// <summary>
/// Gets or sets the currently selected color stop. /// Gets or sets the currently selected color stop.
@ -45,7 +45,7 @@ public class GradientPicker : TemplatedControl
/// Gets or sets a storage provider to use for storing and loading gradients. /// Gets or sets a storage provider to use for storing and loading gradients.
/// </summary> /// </summary>
public static readonly StyledProperty<IColorGradientStorageProvider?> StorageProviderProperty = public static readonly StyledProperty<IColorGradientStorageProvider?> StorageProviderProperty =
AvaloniaProperty.Register<GradientPicker, IColorGradientStorageProvider?>(nameof(StorageProvider), notifying: StorageProviderChanged); AvaloniaProperty.Register<GradientPicker, IColorGradientStorageProvider?>(nameof(StorageProvider));
/// <summary> /// <summary>
/// Gets the linear gradient brush representing the color gradient. /// Gets the linear gradient brush representing the color gradient.
@ -66,7 +66,7 @@ public class GradientPicker : TemplatedControl
AvaloniaProperty.RegisterDirect<GradientPicker, ColorGradient>(nameof(EditingColorGradient), g => g.EditingColorGradient); AvaloniaProperty.RegisterDirect<GradientPicker, ColorGradient>(nameof(EditingColorGradient), g => g.EditingColorGradient);
private readonly ICommand _deleteStop; private readonly ICommand _deleteStop;
private ColorPicker? _colorPicker; private FAColorPicker? _colorPicker;
private Button? _flipStops; private Button? _flipStops;
private Border? _gradient; private Border? _gradient;
private Button? _randomize; private Button? _randomize;
@ -102,7 +102,11 @@ public class GradientPicker : TemplatedControl
public ColorGradient ColorGradient public ColorGradient ColorGradient
{ {
get => GetValue(ColorGradientProperty); get => GetValue(ColorGradientProperty);
set => SetValue(ColorGradientProperty, value); set
{
SetValue(ColorGradientProperty, value);
ApplyToField();
}
} }
/// <summary> /// <summary>
@ -176,7 +180,7 @@ public class GradientPicker : TemplatedControl
if (_randomize != null) if (_randomize != null)
_randomize.Click -= RandomizeOnClick; _randomize.Click -= RandomizeOnClick;
_colorPicker = e.NameScope.Find<ColorPicker>("ColorPicker"); _colorPicker = e.NameScope.Find<FAColorPicker>("ColorPicker");
_gradient = e.NameScope.Find<Border>("Gradient"); _gradient = e.NameScope.Find<Border>("Gradient");
_spreadStops = e.NameScope.Find<Button>("SpreadStops"); _spreadStops = e.NameScope.Find<Button>("SpreadStops");
_toggleSeamless = e.NameScope.Find<Button>("ToggleSeamless"); _toggleSeamless = e.NameScope.Find<Button>("ToggleSeamless");
@ -220,16 +224,6 @@ public class GradientPicker : TemplatedControl
_shiftDown = false; _shiftDown = false;
} }
private static void ColorGradientChanged(IAvaloniaObject sender, bool before)
{
(sender as GradientPicker)?.ApplyToField();
}
private static void StorageProviderChanged(IAvaloniaObject sender, bool before)
{
}
private void ApplyToField() private void ApplyToField()
{ {
EditingColorGradient = new ColorGradient(ColorGradient); EditingColorGradient = new ColorGradient(ColorGradient);

View File

@ -12,7 +12,6 @@ using Avalonia.Interactivity;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Threading; using Avalonia.Threading;
using FluentAvalonia.Core; using FluentAvalonia.Core;
using Button = FluentAvalonia.UI.Controls.Button;
namespace Artemis.UI.Shared.Controls.GradientPicker; namespace Artemis.UI.Shared.Controls.GradientPicker;
@ -25,7 +24,7 @@ public class GradientPickerButton : TemplatedControl
/// Gets or sets the color gradient. /// Gets or sets the color gradient.
/// </summary> /// </summary>
public static readonly StyledProperty<ColorGradient?> ColorGradientProperty = public static readonly StyledProperty<ColorGradient?> ColorGradientProperty =
AvaloniaProperty.Register<GradientPickerButton, ColorGradient?>(nameof(ColorGradient), notifying: ColorGradientChanged); AvaloniaProperty.Register<GradientPickerButton, ColorGradient?>(nameof(ColorGradient));
/// <summary> /// <summary>
/// Gets or sets a boolean indicating whether the gradient picker should be in compact mode or not. /// Gets or sets a boolean indicating whether the gradient picker should be in compact mode or not.
@ -54,7 +53,11 @@ public class GradientPickerButton : TemplatedControl
public ColorGradient? ColorGradient public ColorGradient? ColorGradient
{ {
get => GetValue(ColorGradientProperty); get => GetValue(ColorGradientProperty);
set => SetValue(ColorGradientProperty, value); set
{
SetValue(ColorGradientProperty, value);
Subscribe();
}
} }
/// <summary> /// <summary>
@ -105,12 +108,6 @@ public class GradientPickerButton : TemplatedControl
#endregion #endregion
private static void ColorGradientChanged(IAvaloniaObject sender, bool before)
{
if (!before)
(sender as GradientPickerButton)?.Subscribe();
}
private void Subscribe() private void Subscribe()
{ {
Unsubscribe(); Unsubscribe();

View File

@ -16,7 +16,7 @@ internal class GradientPickerColorStop : TemplatedControl
/// Gets or sets the gradient picker. /// Gets or sets the gradient picker.
/// </summary> /// </summary>
public static readonly StyledProperty<GradientPicker?> GradientPickerProperty = public static readonly StyledProperty<GradientPicker?> GradientPickerProperty =
AvaloniaProperty.Register<GradientPickerColorStop, GradientPicker?>(nameof(GradientPicker), notifying: Notifying); AvaloniaProperty.Register<GradientPickerColorStop, GradientPicker?>(nameof(GradientPicker));
/// <summary> /// <summary>
/// Gets or sets the color stop. /// Gets or sets the color stop.
@ -28,8 +28,8 @@ internal class GradientPickerColorStop : TemplatedControl
/// Gets or sets the position reference to use when positioning and dragging this color stop. /// Gets or sets the position reference to use when positioning and dragging this color stop.
/// <para>If <see langword="null" /> then dragging is not enabled.</para> /// <para>If <see langword="null" /> then dragging is not enabled.</para>
/// </summary> /// </summary>
public static readonly StyledProperty<IControl?> PositionReferenceProperty = public static readonly StyledProperty<Control?> PositionReferenceProperty =
AvaloniaProperty.Register<GradientPickerColorStop, IControl?>(nameof(PositionReference)); AvaloniaProperty.Register<GradientPickerColorStop, Control?>(nameof(PositionReference));
/// <summary> /// <summary>
/// Gets the linear gradient brush representing the color gradient. /// Gets the linear gradient brush representing the color gradient.
@ -47,7 +47,16 @@ internal class GradientPickerColorStop : TemplatedControl
public GradientPicker? GradientPicker public GradientPicker? GradientPicker
{ {
get => GetValue(GradientPickerProperty); get => GetValue(GradientPickerProperty);
set => SetValue(GradientPickerProperty, value); set
{
if (GradientPicker != null)
GradientPicker.PropertyChanged -= GradientPickerOnPropertyChanged;
SetValue(GradientPickerProperty, value);
if (GradientPicker != null)
GradientPicker.PropertyChanged += GradientPickerOnPropertyChanged;
IsSelected = ReferenceEquals(GradientPicker?.SelectedColorStop, ColorStop);
}
} }
/// <summary> /// <summary>
@ -63,7 +72,7 @@ internal class GradientPickerColorStop : TemplatedControl
/// Gets or sets the position reference to use when positioning and dragging this color stop. /// Gets or sets the position reference to use when positioning and dragging this color stop.
/// <para>If <see langword="null" /> then dragging is not enabled.</para> /// <para>If <see langword="null" /> then dragging is not enabled.</para>
/// </summary> /// </summary>
public IControl? PositionReference public Control? PositionReference
{ {
get => GetValue(PositionReferenceProperty); get => GetValue(PositionReferenceProperty);
set => SetValue(PositionReferenceProperty, value); set => SetValue(PositionReferenceProperty, value);
@ -85,19 +94,6 @@ internal class GradientPickerColorStop : TemplatedControl
} }
} }
private static void Notifying(IAvaloniaObject sender, bool before)
{
if (sender is not GradientPickerColorStop self)
return;
if (before && self.GradientPicker != null)
self.GradientPicker.PropertyChanged -= self.GradientPickerOnPropertyChanged;
else if (self.GradientPicker != null)
self.GradientPicker.PropertyChanged += self.GradientPickerOnPropertyChanged;
self.IsSelected = ReferenceEquals(self.GradientPicker?.SelectedColorStop, self.ColorStop);
}
private void GradientPickerOnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e) private void GradientPickerOnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e)
{ {
if (GradientPicker != null && e.Property == GradientPicker.SelectedColorStopProperty) if (GradientPicker != null && e.Property == GradientPicker.SelectedColorStopProperty)

View File

@ -17,7 +17,7 @@ namespace Artemis.UI.Shared;
/// <summary> /// <summary>
/// Represents a control that can be used to display or edit <see cref="Core.Hotkey" /> instances. /// Represents a control that can be used to display or edit <see cref="Core.Hotkey" /> instances.
/// </summary> /// </summary>
public class HotkeyBox : UserControl public partial class HotkeyBox : UserControl
{ {
private readonly TextBox _displayTextBox; private readonly TextBox _displayTextBox;
@ -34,11 +34,6 @@ public class HotkeyBox : UserControl
UpdateDisplayTextBox(); UpdateDisplayTextBox();
} }
private static void HotkeyChanging(IAvaloniaObject sender, bool before)
{
((HotkeyBox) sender).UpdateDisplayTextBox();
}
private void DisplayTextBoxOnKeyDown(object? sender, KeyEventArgs e) private void DisplayTextBoxOnKeyDown(object? sender, KeyEventArgs e)
{ {
if (e.Key >= Key.LeftShift && e.Key <= Key.RightAlt) if (e.Key >= Key.LeftShift && e.Key <= Key.RightAlt)
@ -92,20 +87,17 @@ public class HotkeyBox : UserControl
/// Gets or sets the currently displayed icon as either a <see cref="MaterialIconKind" /> or an <see cref="Uri" /> /// Gets or sets the currently displayed icon as either a <see cref="MaterialIconKind" /> or an <see cref="Uri" />
/// pointing to an SVG /// pointing to an SVG
/// </summary> /// </summary>
public static readonly StyledProperty<Hotkey?> HotkeyProperty = public static readonly StyledProperty<Hotkey?> HotkeyProperty = AvaloniaProperty.Register<HotkeyBox, Hotkey?>(nameof(Hotkey), defaultBindingMode: BindingMode.TwoWay);
AvaloniaProperty.Register<HotkeyBox, Hotkey?>(nameof(Hotkey), defaultBindingMode: BindingMode.TwoWay, notifying: HotkeyChanging);
/// <summary> /// <summary>
/// Gets or sets the watermark of the hotkey box when it is empty. /// Gets or sets the watermark of the hotkey box when it is empty.
/// </summary> /// </summary>
public static readonly StyledProperty<string?> WatermarkProperty = public static readonly StyledProperty<string?> WatermarkProperty = AvaloniaProperty.Register<HotkeyBox, string?>(nameof(Watermark));
AvaloniaProperty.Register<HotkeyBox, string?>(nameof(Watermark));
/// <summary> /// <summary>
/// Gets or sets a boolean indicating whether the watermark should float above the hotkey box when it is not empty. /// Gets or sets a boolean indicating whether the watermark should float above the hotkey box when it is not empty.
/// </summary> /// </summary>
public static readonly StyledProperty<bool> UseFloatingWatermarkProperty = public static readonly StyledProperty<bool> UseFloatingWatermarkProperty = AvaloniaProperty.Register<HotkeyBox, bool>(nameof(UseFloatingWatermark));
AvaloniaProperty.Register<HotkeyBox, bool>(nameof(UseFloatingWatermark));
/// <summary> /// <summary>
/// Gets or sets the currently displayed icon as either a <see cref="MaterialIconKind" /> or an <see cref="Uri" /> /// Gets or sets the currently displayed icon as either a <see cref="MaterialIconKind" /> or an <see cref="Uri" />
@ -114,7 +106,11 @@ public class HotkeyBox : UserControl
public Hotkey? Hotkey public Hotkey? Hotkey
{ {
get => GetValue(HotkeyProperty); get => GetValue(HotkeyProperty);
set => SetValue(HotkeyProperty, value); set
{
SetValue(HotkeyProperty, value);
UpdateDisplayTextBox();
}
} }
/// <summary> /// <summary>

View File

@ -3,13 +3,13 @@ using System.IO;
using Artemis.Core; using Artemis.Core;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Documents;
using Avalonia.Layout; using Avalonia.Layout;
using Avalonia.LogicalTree; using Avalonia.LogicalTree;
using Avalonia.Markup.Xaml; using Avalonia.Markup.Xaml;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Media.Imaging; using Avalonia.Media.Imaging;
using Avalonia.Threading; using Avalonia.Threading;
using Avalonia.Visuals.Media.Imaging;
using Material.Icons; using Material.Icons;
using Material.Icons.Avalonia; using Material.Icons.Avalonia;
@ -18,7 +18,7 @@ namespace Artemis.UI.Shared;
/// <summary> /// <summary>
/// Represents a control that can display the icon of a specific <see cref="ProfileConfiguration" />. /// Represents a control that can display the icon of a specific <see cref="ProfileConfiguration" />.
/// </summary> /// </summary>
public class ProfileConfigurationIcon : UserControl, IDisposable public partial class ProfileConfigurationIcon : UserControl, IDisposable
{ {
private Stream? _stream; private Stream? _stream;
@ -72,7 +72,7 @@ public class ProfileConfigurationIcon : UserControl, IDisposable
Content = new Border Content = new Border
{ {
Background = TextBlock.GetForeground(this), Background = TextElement.GetForeground(this),
VerticalAlignment = VerticalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch,
HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalAlignment = HorizontalAlignment.Stretch,
OpacityMask = new ImageBrush(new Bitmap(stream)) {BitmapInterpolationMode = BitmapInterpolationMode.MediumQuality} OpacityMask = new ImageBrush(new Bitmap(stream)) {BitmapInterpolationMode = BitmapInterpolationMode.MediumQuality}

View File

@ -40,8 +40,8 @@ public class SelectionRectangle : Control
/// <summary> /// <summary>
/// Defines the <see cref="InputElement" /> property. /// Defines the <see cref="InputElement" /> property.
/// </summary> /// </summary>
public static readonly StyledProperty<IControl?> InputElementProperty = public static readonly StyledProperty<InputElement?> InputElementProperty =
AvaloniaProperty.Register<SelectionRectangle, IControl?>(nameof(InputElement), notifying: OnInputElementChanged); AvaloniaProperty.Register<SelectionRectangle, InputElement?>(nameof(InputElement));
/// <summary> /// <summary>
/// Defines the <see cref="ZoomRatio" /> property. /// Defines the <see cref="ZoomRatio" /> property.
@ -61,7 +61,7 @@ public class SelectionRectangle : Control
private Rect? _displayRect; private Rect? _displayRect;
private bool _isSelecting; private bool _isSelecting;
private Point _lastPosition; private Point _lastPosition;
private IControl? _oldInputElement; private InputElement? _oldInputElement;
private Point _startPosition; private Point _startPosition;
/// <inheritdoc /> /// <inheritdoc />
@ -110,10 +110,14 @@ public class SelectionRectangle : Control
/// <summary> /// <summary>
/// Gets or sets the element that captures input for the selection rectangle. /// Gets or sets the element that captures input for the selection rectangle.
/// </summary> /// </summary>
public IControl? InputElement public InputElement? InputElement
{ {
get => GetValue(InputElementProperty); get => GetValue(InputElementProperty);
set => SetValue(InputElementProperty, value); set
{
SetValue(InputElementProperty, value);
SubscribeToInputElement();
}
} }
/// <summary> /// <summary>
@ -162,11 +166,6 @@ public class SelectionRectangle : Control
SelectionFinished?.Invoke(this, e); SelectionFinished?.Invoke(this, e);
} }
private static void OnInputElementChanged(IAvaloniaObject sender, bool before)
{
((SelectionRectangle) sender).SubscribeToInputElement();
}
private void ParentOnPointerMoved(object? sender, PointerEventArgs e) private void ParentOnPointerMoved(object? sender, PointerEventArgs e)
{ {
// Point moved seems to trigger when the element under the mouse changes? // Point moved seems to trigger when the element under the mouse changes?
@ -185,13 +184,13 @@ public class SelectionRectangle : Control
{ {
e.Pointer.Capture(this); e.Pointer.Capture(this);
_startPosition = e.GetPosition(Parent); _startPosition = e.GetPosition(Parent as Visual);
_absoluteStartPosition = e.GetPosition(VisualRoot); _absoluteStartPosition = e.GetPosition(VisualRoot as Visual);
_displayRect = null; _displayRect = null;
} }
Point currentPosition = e.GetPosition(Parent); Point currentPosition = e.GetPosition(Parent as Visual);
Point absoluteCurrentPosition = e.GetPosition(VisualRoot); Point absoluteCurrentPosition = e.GetPosition(VisualRoot as Visual);
_displayRect = new Rect( _displayRect = new Rect(
new Point(Math.Min(_startPosition.X, currentPosition.X), Math.Min(_startPosition.Y, currentPosition.Y)), new Point(Math.Min(_startPosition.X, currentPosition.X), Math.Min(_startPosition.Y, currentPosition.Y)),

View File

@ -15,7 +15,7 @@ public class ParentWidthPercentageConverter : IValueConverter
/// <inheritdoc /> /// <inheritdoc />
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
{ {
if (parameter is not IControl parent || value is not double percentage) if (parameter is not Control parent || value is not double percentage)
return value; return value;
return parent.Width / 100.0 * percentage; return parent.Width / 100.0 * percentage;
@ -24,7 +24,7 @@ public class ParentWidthPercentageConverter : IValueConverter
/// <inheritdoc /> /// <inheritdoc />
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
{ {
if (parameter is not IControl parent || value is not double real) if (parameter is not Control parent || value is not double real)
return value; return value;
return real / parent.Width * 100.0; return real / parent.Width * 100.0;

View File

@ -6,7 +6,7 @@ namespace Artemis.UI.Shared.DefaultTypes.DataModel.Display;
/// <summary> /// <summary>
/// Represents a default data model display view. /// Represents a default data model display view.
/// </summary> /// </summary>
public class DefaultDataModelDisplayView : UserControl public partial class DefaultDataModelDisplayView : UserControl
{ {
/// <summary> /// <summary>
/// Creates a new instance of the <see cref="DefaultDataModelDisplayView" /> class. /// Creates a new instance of the <see cref="DefaultDataModelDisplayView" /> class.

View File

@ -7,7 +7,7 @@ namespace Artemis.UI.Shared.DefaultTypes.DataModel.Display;
/// <summary> /// <summary>
/// Represents a data model display view used to display <see cref="SKColor" /> values. /// Represents a data model display view used to display <see cref="SKColor" /> values.
/// </summary> /// </summary>
public class SKColorDataModelDisplayView : UserControl public partial class SKColorDataModelDisplayView : UserControl
{ {
/// <summary> /// <summary>
/// Creates a new instance of the <see cref="SKColorDataModelDisplayView" /> class. /// Creates a new instance of the <see cref="SKColorDataModelDisplayView" /> class.

View File

@ -6,7 +6,7 @@ using Avalonia.VisualTree;
namespace Artemis.UI.Shared.Extensions; namespace Artemis.UI.Shared.Extensions;
/// <summary> /// <summary>
/// Provides extension methods for Avalonia's <see cref="IVisual" /> type /// Provides extension methods for Avalonia's <see cref="Visual" /> type
/// </summary> /// </summary>
public static class VisualExtensions public static class VisualExtensions
{ {
@ -16,15 +16,15 @@ public static class VisualExtensions
/// <typeparam name="T">The type the children should have.</typeparam> /// <typeparam name="T">The type the children should have.</typeparam>
/// <param name="root">The root visual at which to start searching.</param> /// <param name="root">The root visual at which to start searching.</param>
/// <returns>A recursive list of all visual children of type <typeparamref name="T" />.</returns> /// <returns>A recursive list of all visual children of type <typeparamref name="T" />.</returns>
public static List<T> GetVisualChildrenOfType<T>(this IVisual root) public static List<T> GetVisualChildrenOfType<T>(this Visual root)
{ {
List<T> result = new(); List<T> result = new();
List<IVisual>? visualChildren = root.GetVisualChildren()?.ToList(); List<Visual>? visualChildren = root.GetVisualChildren()?.ToList();
if (visualChildren == null || !visualChildren.Any()) if (visualChildren == null || !visualChildren.Any())
return result; return result;
foreach (IVisual visualChild in visualChildren) foreach (Visual visualChild in visualChildren)
{ {
if (visualChild is T toFind) if (visualChild is T toFind)
result.Add(toFind); result.Add(toFind);
@ -41,15 +41,15 @@ public static class VisualExtensions
/// <typeparam name="T">The type of data context the children should have.</typeparam> /// <typeparam name="T">The type of data context the children should have.</typeparam>
/// <param name="root">The root visual at which to start searching.</param> /// <param name="root">The root visual at which to start searching.</param>
/// <returns>A recursive list of all visual children with a data context of type <typeparamref name="T" />.</returns> /// <returns>A recursive list of all visual children with a data context of type <typeparamref name="T" />.</returns>
public static List<T> GetVisualChildrenOfDataContextType<T>(this IVisual root) public static List<T> GetVisualChildrenOfDataContextType<T>(this Visual root)
{ {
List<T> result = new(); List<T> result = new();
List<IVisual>? visualChildren = root.GetVisualChildren()?.ToList(); List<Visual>? visualChildren = root.GetVisualChildren()?.ToList();
if (visualChildren == null || !visualChildren.Any()) if (visualChildren == null || !visualChildren.Any())
return result; return result;
foreach (IVisual visualChild in visualChildren) foreach (Visual visualChild in visualChildren)
{ {
if (visualChild is IDataContextProvider dataContextProvider && dataContextProvider.DataContext is T toFind) if (visualChild is IDataContextProvider dataContextProvider && dataContextProvider.DataContext is T toFind)
result.Add(toFind); result.Add(toFind);

View File

@ -4,8 +4,8 @@ using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Media; using Avalonia.Media;
using Avalonia.Media.Immutable; using Avalonia.Media.Immutable;
using FluentAvalonia.UI.Controls;
using FluentAvalonia.UI.Media; using FluentAvalonia.UI.Media;
using FluentAvalonia.UI.Windowing;
using ReactiveUI; using ReactiveUI;
namespace Artemis.UI.Shared; namespace Artemis.UI.Shared;
@ -17,18 +17,18 @@ namespace Artemis.UI.Shared;
/// and vice versa. /// and vice versa.
/// </summary> /// </summary>
/// <typeparam name="TViewModel">ViewModel type.</typeparam> /// <typeparam name="TViewModel">ViewModel type.</typeparam>
public class ReactiveCoreWindow<TViewModel> : CoreWindow, IViewFor<TViewModel> where TViewModel : class public class ReactiveAppWindow<TViewModel> : AppWindow, IViewFor<TViewModel> where TViewModel : class
{ {
/// <summary> /// <summary>
/// The ViewModel. /// The ViewModel.
/// </summary> /// </summary>
public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty public static readonly StyledProperty<TViewModel?> ViewModelProperty = AvaloniaProperty
.Register<ReactiveCoreWindow<TViewModel>, TViewModel?>(nameof(ViewModel)); .Register<ReactiveAppWindow<TViewModel>, TViewModel?>(nameof(ViewModel));
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ReactiveCoreWindow{TViewModel}" /> class. /// Initializes a new instance of the <see cref="ReactiveAppWindow{TViewModel}" /> class.
/// </summary> /// </summary>
public ReactiveCoreWindow() public ReactiveAppWindow()
{ {
// This WhenActivated block calls ViewModel's WhenActivated // This WhenActivated block calls ViewModel's WhenActivated
// block if the ViewModel implements IActivatableViewModel. // block if the ViewModel implements IActivatableViewModel.

View File

@ -116,7 +116,7 @@ public class NotificationBuilder
/// <exception cref="ArtemisSharedUIException" /> /// <exception cref="ArtemisSharedUIException" />
public Action Show() public Action Show()
{ {
IPanel? panel = _parent.Find<IPanel>("NotificationContainer"); Panel? panel = _parent.Find<Panel>("NotificationContainer");
if (panel == null) if (panel == null)
throw new ArtemisSharedUIException("Can't display a notification on a window without a NotificationContainer."); throw new ArtemisSharedUIException("Can't display a notification on a window without a NotificationContainer.");
@ -202,7 +202,7 @@ public class NotificationButtonBuilder
return this; return this;
} }
internal IControl Build() internal Control Build()
{ {
if (_action != null) if (_action != null)
return new Button {Content = _text, Command = ReactiveCommand.Create(() => _action()), Classes = new Classes("AppBarButton")}; return new Button {Content = _text, Command = ReactiveCommand.Create(() => _action()), Classes = new Classes("AppBarButton")};

View File

@ -4,7 +4,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Shared.Services; namespace Artemis.UI.Shared.Services;
internal class ExceptionDialogView : ReactiveWindow<ExceptionDialogViewModel> internal partial class ExceptionDialogView : ReactiveWindow<ExceptionDialogViewModel>
{ {
public ExceptionDialogView() public ExceptionDialogView()
{ {

View File

@ -3,13 +3,13 @@
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"> xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="20"> <Border Padding="20">
<Grid Height="24" ColumnDefinitions="*"> <Grid Height="24" ColumnDefinitions="*">
<TextBox Classes="condensed" <TextBox Classes="condensed"
Text="#FFFF0000" Text="#FFFF0000"
Padding="2 2 30 2"> Padding="2 2 30 2">
</TextBox> </TextBox>
<controls:ColorPickerButton Classes="contained-color-picker-button" <controls:ColorPickerButton Classes="contained-color-picker-button"
ShowAcceptDismissButtons="False"/> ShowAcceptDismissButtons="False" />
</Grid> </Grid>
</Border> </Border>
</Design.PreviewWith> </Design.PreviewWith>
@ -27,19 +27,19 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate> <ControlTemplate>
<controls:Button Name="MainButton" <Button Name="MainButton"
Padding="0" Padding="0"
BorderThickness="0" BorderThickness="0"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">
<Border BorderBrush="{DynamicResource ColorPickerButtonOutline}" <Border BorderBrush="{DynamicResource ColorPickerButtonOutline}"
BorderThickness="1" BorderThickness="1"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
MinWidth="18" MinHeight="18" MinWidth="18" MinHeight="18"
Background="{TemplateBinding Color, Converter={StaticResource ColorBrushConv}}" Background="{TemplateBinding Color, Converter={StaticResource ColorBrushConv}}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">
<controls:ColorPicker Name="ColorPicker" IsVisible="False" /> <controls:FAColorPicker Name="ColorPicker" IsVisible="False" />
</Border> </Border>
</controls:Button> </Button>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
@ -48,4 +48,4 @@
<Style Selector="controls|ColorPickerButton.contained-color-picker-button /template/ Viewbox"> <Style Selector="controls|ColorPickerButton.contained-color-picker-button /template/ Viewbox">
<Setter Property="IsVisible" Value="False"></Setter> <Setter Property="IsVisible" Value="False"></Setter>
</Style> </Style>
</Styles> </Styles>

View File

@ -102,7 +102,7 @@
<Setter Property="MinHeight" Value="24" /> <Setter Property="MinHeight" Value="24" />
</Style> </Style>
<Style Selector="dataModelPicker|DataModelPickerButton.condensed /template/ controls|Button"> <Style Selector="dataModelPicker|DataModelPickerButton.condensed /template/ Button">
<Setter Property="Padding" Value="6 3 11 3" /> <Setter Property="Padding" Value="6 3 11 3" />
<Setter Property="Height" Value="24" /> <Setter Property="Height" Value="24" />
</Style> </Style>

View File

@ -27,20 +27,20 @@
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<controls:Button Name="MainButton" <Button Name="MainButton"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
Width="{TemplateBinding Width}" Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}" Height="{TemplateBinding Height}"
HorizontalContentAlignment="Stretch"> HorizontalContentAlignment="Stretch">
<Grid ColumnDefinitions="*,Auto" HorizontalAlignment="Stretch"> <Grid ColumnDefinitions="*,Auto" HorizontalAlignment="Stretch">
<TextBlock Name="MainButtonLabel" <TextBlock Name="MainButtonLabel"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
TextAlignment="Left" TextAlignment="Left"
TextTrimming="CharacterEllipsis"/> TextTrimming="CharacterEllipsis" />
<TextBlock Name="ChevronTextBlock" <TextBlock Name="ChevronTextBlock"
Grid.Column="1" Grid.Column="1"
FontFamily="{DynamicResource SymbolThemeFontFamily}" FontFamily="{DynamicResource SymbolThemeFontFamily}"
@ -51,7 +51,7 @@
Padding="2 2 2 0" Padding="2 2 2 0"
Margin="5 0" /> Margin="5 0" />
</Grid> </Grid>
</controls:Button> </Button>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>

View File

@ -168,14 +168,14 @@
BorderBrush="{DynamicResource ButtonBorderBrush}" BorderBrush="{DynamicResource ButtonBorderBrush}"
BorderThickness="0 0 1 0" BorderThickness="0 0 1 0"
Padding="0 0 10 0"> Padding="0 0 10 0">
<fluent:ColorPicker Name="ColorPicker" <fluent:FAColorPicker Name="ColorPicker"
ColorTextType="HexAlpha" ColorTextType="HexAlpha"
UseColorWheel="True" UseColorWheel="True"
UseColorTriangle="True" UseColorTriangle="True"
IsMoreButtonVisible="True" IsMoreButtonVisible="True"
IsVisible="{TemplateBinding SelectedColorStop, Converter={x:Static ObjectConverters.IsNotNull}}" IsVisible="{TemplateBinding SelectedColorStop, Converter={x:Static ObjectConverters.IsNotNull}}"
IsCompact="{Binding IsCompact, RelativeSource={RelativeSource TemplatedParent}}" IsCompact="{Binding IsCompact, RelativeSource={RelativeSource TemplatedParent}}"
Color="{Binding SelectedColorStop.Color, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource SKColorToColorConverter}}" /> Color="{Binding SelectedColorStop.Color, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource SKColorToColorConverter}}" />
</Border> </Border>
<Grid Grid.Row="2" Grid.Column="1" RowDefinitions="*,Auto"> <Grid Grid.Row="2" Grid.Column="1" RowDefinitions="*,Auto">

View File

@ -1,15 +1,13 @@
<Styles xmlns="https://github.com/avaloniaui" <Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.Controls.GradientPicker"> xmlns:gradientPicker="clr-namespace:Artemis.UI.Shared.Controls.GradientPicker">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="20" Width="200"> <Border Padding="20" Width="200">
<StackPanel Spacing="5"> <StackPanel Spacing="5">
<gradientPicker:GradientPickerButton IsCompact="True" /> <gradientPicker:GradientPickerButton IsCompact="True" />
<ComboBox HorizontalAlignment="Stretch"></ComboBox> <ComboBox HorizontalAlignment="Stretch"></ComboBox>
<controls:DropDownButton HorizontalAlignment="Stretch"></controls:DropDownButton> <DropDownButton HorizontalAlignment="Stretch"></DropDownButton>
</StackPanel> </StackPanel>
</Border> </Border>
</Design.PreviewWith> </Design.PreviewWith>
@ -31,14 +29,14 @@
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<controls:Button <Button
Name="MainButton" Name="MainButton"
Padding="0 0 12 0" Padding="0 0 12 0"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
HorizontalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"> VerticalContentAlignment="Stretch">
<Grid ColumnDefinitions="*,Auto"> <Grid ColumnDefinitions="*,Auto">
<Border Classes="gradient-display" <Border Classes="gradient-display"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
@ -54,7 +52,7 @@
Margin="4,0,0,0" /> Margin="4,0,0,0" />
</Grid> </Grid>
</controls:Button> </Button>
</ControlTemplate> </ControlTemplate>

View File

@ -1,15 +1,15 @@
<Styles xmlns="https://github.com/avaloniaui" <Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Design.PreviewWith> <Design.PreviewWith>
<Border Padding="30" MinWidth="350" Height="600"> <Border Padding="30" MinWidth="350" Height="600">
<TreeView Classes="no-right-margin"> <TreeView Classes="no-right-margin">
<TreeViewItem> <TreeViewItem>
<TreeViewItem.Header> <TreeViewItem.Header>
<Border BorderThickness="2" BorderBrush="Red"> <Border BorderThickness="2" BorderBrush="Red">
<TextBlock>Test</TextBlock> <TextBlock>Test</TextBlock>
</Border> </Border>
</TreeViewItem.Header> </TreeViewItem.Header>
</TreeViewItem> </TreeViewItem>
<TreeViewItem Header="Item 2" IsExpanded="True"> <TreeViewItem Header="Item 2" IsExpanded="True">
<TreeViewItem> <TreeViewItem>
@ -21,7 +21,7 @@
</TreeViewItem> </TreeViewItem>
<TreeViewItem Header="SubItem2" /> <TreeViewItem Header="SubItem2" />
<TreeViewItem Header="SubItem3" IsExpanded="True"> <TreeViewItem Header="SubItem3" IsExpanded="True">
<TreeViewItem> <TreeViewItem>
<TreeViewItem.Header> <TreeViewItem.Header>
<Border BorderThickness="2" BorderBrush="Red"> <Border BorderThickness="2" BorderBrush="Red">
<TextBlock>Test</TextBlock> <TextBlock>Test</TextBlock>
@ -32,17 +32,17 @@
<TreeViewItem Header="SubItem Item3" /> <TreeViewItem Header="SubItem Item3" />
</TreeViewItem> </TreeViewItem>
</TreeViewItem> </TreeViewItem>
<TreeViewItem Header="Item3" IsEnabled="False"/> <TreeViewItem Header="Item3" IsEnabled="False" />
<TreeViewItem Header="Item4" /> <TreeViewItem Header="Item4" />
</TreeView> </TreeView>
</Border> </Border>
</Design.PreviewWith> </Design.PreviewWith>
<Style Selector="TreeView.no-right-margin TreeViewItem"> <Style Selector="TreeView.no-right-margin TreeViewItem">
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<StackPanel> <StackPanel>
<Border Name="PART_LayoutRoot" <Border Name="PART_LayoutRoot"
Classes="TreeViewItemLayoutRoot" Classes="TreeViewItemLayoutRoot"
Focusable="True" Focusable="True"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
@ -52,56 +52,59 @@
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
TemplatedControl.IsTemplateFocusTarget="True" TemplatedControl.IsTemplateFocusTarget="True"
Margin="2 2 0 2"> Margin="2 2 0 2">
<Panel> <Panel>
<Border Name="SelectionIndicator" <Rectangle Name="SelectionIndicator"
Width="3" Width="3"
Height="16" Height="16"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
CornerRadius="2" /> RadiusX="2"
RadiusY="2"
<Grid Name="PART_Header" IsVisible="False"
ColumnDefinitions="Auto, *" Fill="{DynamicResource TreeViewItemSelectionIndicatorForeground}" />
Margin="{TemplateBinding Level, Mode=OneWay, Converter={StaticResource TreeViewItemLeftMarginConverter}}">
<Panel Name="PART_ExpandCollapseChevronContainer" <Grid Name="PART_Header"
Margin="8 0 4 0"> ColumnDefinitions="Auto, *"
<ToggleButton Name="PART_ExpandCollapseChevron" Margin="{TemplateBinding Level, Mode=OneWay, Converter={StaticResource TreeViewItemLeftMarginConverter}}">
Classes="ExpandCollapseChevron" <Panel Name="PART_ExpandCollapseChevronContainer"
Margin="{StaticResource TreeViewItemExpandCollapseChevronMargin}">
<ToggleButton Name="PART_ExpandCollapseChevron"
Theme="{StaticResource TreeViewChevronButton}"
Focusable="False" Focusable="False"
IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}" /> IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}" />
</Panel> </Panel>
<ContentPresenter Name="PART_HeaderPresenter" <ContentPresenter Name="PART_HeaderPresenter"
Grid.Column="1" Grid.Column="1"
Focusable="False" Focusable="False"
Content="{TemplateBinding Header}" Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"
Margin="{TemplateBinding Padding}" /> Margin="{TemplateBinding Padding}" />
</Grid> </Grid>
</Panel> </Panel>
</Border> </Border>
<ItemsPresenter Name="PART_ItemsPresenter" <ItemsPresenter Name="PART_ItemsPresenter"
IsVisible="{TemplateBinding IsExpanded}" IsVisible="{TemplateBinding IsExpanded}"
Items="{TemplateBinding Items}"
ItemsPanel="{TemplateBinding ItemsPanel}" ItemsPanel="{TemplateBinding ItemsPanel}"
Margin="2 2 0 2"/> Margin="2 2 0 2"/>
</StackPanel> </StackPanel>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="Border#TreeViewItemLayoutRoot Panel.PART_ExpandCollapseChevronContainer"> <Style Selector="Border#TreeViewItemLayoutRoot Panel.PART_ExpandCollapseChevronContainer">
<Setter Property="Margin" Value="0"></Setter> <Setter Property="Margin" Value="0"></Setter>
</Style> </Style>
<Style Selector="TreeView TreeViewItem[IsEnabled=False]"> <Style Selector="TreeView TreeViewItem[IsEnabled=False]">
<Setter Property="Foreground" Value="{DynamicResource ButtonDisabledForegroundThemeBrush}"/> <Setter Property="Foreground" Value="{DynamicResource ButtonDisabledForegroundThemeBrush}" />
</Style> </Style>
<!-- <Style Selector="TreeView.no-right-margin TreeViewItem /template/ Border#TreeViewItemLayoutRoot"> --> <!-- <Style Selector="TreeView.no-right-margin TreeViewItem /template/ Border#TreeViewItemLayoutRoot"> -->
<!-- <Setter Property="Margin" Value="2 2 0 2"/> --> <!-- <Setter Property="Margin" Value="2 2 0 2"/> -->
<!-- </Style> --> <!-- </Style> -->
<!-- <Style Selector="TreeView.no-right-margin TreeViewItem /template/ StackPanel ItemsPresenter#PART_ItemsPresenter"> --> <!-- <Style Selector="TreeView.no-right-margin TreeViewItem /template/ StackPanel ItemsPresenter#PART_ItemsPresenter"> -->
<!-- <Setter Property="Margin" Value="2 2 0 2"/> --> <!-- <Setter Property="Margin" Value="2 2 0 2"/> -->
<!-- </Style> --> <!-- </Style> -->
</Styles> </Styles>

View File

@ -21,18 +21,18 @@
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" /> <PackageReference Include="Avalonia" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" /> <PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview6" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Win32" Version="0.10.18" /> <PackageReference Include="Avalonia.Win32" Version="11.0.0-preview6" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" /> <PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
<PackageReference Include="Microsoft.Win32" Version="2.0.1" /> <PackageReference Include="Microsoft.Win32" Version="2.0.1" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" /> <PackageReference Include="Microsoft.Windows.Compatibility" Version="6.0.0" />
<PackageReference Include="RawInput.Sharp" Version="0.0.4" /> <PackageReference Include="RawInput.Sharp" Version="0.0.4" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="SkiaSharp.Vulkan.SharpVk" Version="2.88.1-preview.108" /> <PackageReference Include="SkiaSharp.Vulkan.SharpVk" Version="2.88.3" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" /> <ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />

View File

@ -15,28 +15,28 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" /> <PackageReference Include="Avalonia" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.AvaloniaEdit" Version="0.10.12.2" /> <PackageReference Include="Avalonia.AvaloniaEdit" Version="11.0.0-preview5" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="10.14.0" /> <PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Controls.Skia" Version="0.10.16" /> <PackageReference Include="Avalonia.Controls.Skia" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.18" /> <PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview6" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> <!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.18" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.18" /> <PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview6" />
<PackageReference Include="DryIoc.dll" Version="5.3.1" /> <PackageReference Include="DryIoc.dll" Version="5.3.1" />
<PackageReference Include="DynamicData" Version="7.9.14" /> <PackageReference Include="DynamicData" Version="7.13.1" />
<PackageReference Include="FluentAvaloniaUI" Version="1.4.1" /> <PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview6" />
<PackageReference Include="Flurl.Http" Version="3.2.4" /> <PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Live.Avalonia" Version="1.3.1" /> <PackageReference Include="Live.Avalonia" Version="1.3.1" />
<PackageReference Include="Markdown.Avalonia.Tight" Version="0.10.13" /> <PackageReference Include="Markdown.Avalonia.Tight" Version="0.10.13" />
<PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" /> <PackageReference Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageReference Include="Octopus.Octodiff" Version="2.0.100" /> <PackageReference Include="Octopus.Octodiff" Version="2.0.100" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />
<PackageReference Include="RGB.NET.Core" Version="2.0.0-prerelease.17" /> <PackageReference Include="RGB.NET.Core" Version="2.0.0-prerelease.17" />
<PackageReference Include="RGB.NET.Layout" Version="2.0.0-prerelease.17" /> <PackageReference Include="RGB.NET.Layout" Version="2.0.0-prerelease.17" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" /> <PackageReference Include="SkiaSharp" Version="2.88.3" />
<PackageReference Include="Splat.DryIoc" Version="14.6.1" /> <PackageReference Include="Splat.DryIoc" Version="14.6.1" />
</ItemGroup> </ItemGroup>

View File

@ -106,7 +106,7 @@ public class SimpleContextDragBehavior : Behavior<Control>
PointerPointProperties properties = e.GetCurrentPoint(AssociatedObject).Properties; PointerPointProperties properties = e.GetCurrentPoint(AssociatedObject).Properties;
if (!properties.IsLeftButtonPressed || FocusManager.Instance?.Current is TextBox) if (!properties.IsLeftButtonPressed || FocusManager.Instance?.Current is TextBox)
return; return;
if (e.Source is not IControl control || AssociatedObject?.DataContext != control.DataContext) if (e.Source is not Control control || AssociatedObject?.DataContext != control.DataContext)
return; return;
_dragStartPoint = e.GetPosition(null); _dragStartPoint = e.GetPosition(null);

View File

@ -2,7 +2,6 @@
using System.Collections; using System.Collections;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Controls.Generators;
using Avalonia.Controls.Primitives; using Avalonia.Controls.Primitives;
using Avalonia.Input; using Avalonia.Input;
using Avalonia.Interactivity; using Avalonia.Interactivity;
@ -14,7 +13,7 @@ namespace Artemis.UI.Behaviors;
/// <summary> /// <summary>
/// </summary> /// </summary>
public class TreeItemDragBehavior : Behavior<IControl> public class TreeItemDragBehavior : Behavior<Control>
{ {
/// <summary> /// <summary>
/// </summary> /// </summary>
@ -31,7 +30,7 @@ public class TreeItemDragBehavior : Behavior<IControl>
public static readonly StyledProperty<double> VerticalDragThresholdProperty = public static readonly StyledProperty<double> VerticalDragThresholdProperty =
AvaloniaProperty.Register<TreeItemDragBehavior, double>(nameof(VerticalDragThreshold), 3); AvaloniaProperty.Register<TreeItemDragBehavior, double>(nameof(VerticalDragThreshold), 3);
private IControl? _draggedContainer; private Control? _draggedContainer;
private int _draggedIndex; private int _draggedIndex;
private bool _dragStarted; private bool _dragStarted;
private bool _enableDrag; private bool _enableDrag;
@ -69,12 +68,12 @@ public class TreeItemDragBehavior : Behavior<IControl>
{ {
base.OnAttached(); base.OnAttached();
if (AssociatedObject is { }) if (AssociatedObject is not null)
{ {
AssociatedObject.AddHandler(InputElement.PointerReleasedEvent, Released, RoutingStrategies.Tunnel); AssociatedObject.AddHandler(InputElement.PointerReleasedEvent, ReleasedHandler, RoutingStrategies.Tunnel);
AssociatedObject.AddHandler(InputElement.PointerPressedEvent, Pressed, RoutingStrategies.Tunnel); AssociatedObject.AddHandler(InputElement.PointerPressedEvent, PressedHandler, RoutingStrategies.Tunnel);
AssociatedObject.AddHandler(InputElement.PointerMovedEvent, Moved, RoutingStrategies.Tunnel); AssociatedObject.AddHandler(InputElement.PointerMovedEvent, MovedHandler, RoutingStrategies.Tunnel);
AssociatedObject.AddHandler(InputElement.PointerCaptureLostEvent, CaptureLost, RoutingStrategies.Tunnel); AssociatedObject.AddHandler(InputElement.PointerCaptureLostEvent, CaptureLostHandler, RoutingStrategies.Tunnel);
} }
} }
@ -84,16 +83,16 @@ public class TreeItemDragBehavior : Behavior<IControl>
{ {
base.OnDetaching(); base.OnDetaching();
if (AssociatedObject is { }) if (AssociatedObject is not null)
{ {
AssociatedObject.RemoveHandler(InputElement.PointerReleasedEvent, Released); AssociatedObject.RemoveHandler(InputElement.PointerReleasedEvent, ReleasedHandler);
AssociatedObject.RemoveHandler(InputElement.PointerPressedEvent, Pressed); AssociatedObject.RemoveHandler(InputElement.PointerPressedEvent, PressedHandler);
AssociatedObject.RemoveHandler(InputElement.PointerMovedEvent, Moved); AssociatedObject.RemoveHandler(InputElement.PointerMovedEvent, MovedHandler);
AssociatedObject.RemoveHandler(InputElement.PointerCaptureLostEvent, CaptureLost); AssociatedObject.RemoveHandler(InputElement.PointerCaptureLostEvent, CaptureLostHandler);
} }
} }
private void Pressed(object? sender, PointerPressedEventArgs e) private void PressedHandler(object? sender, PointerPressedEventArgs e)
{ {
PointerPointProperties properties = e.GetCurrentPoint(AssociatedObject).Properties; PointerPointProperties properties = e.GetCurrentPoint(AssociatedObject).Properties;
if (properties.IsLeftButtonPressed if (properties.IsLeftButtonPressed
@ -101,20 +100,20 @@ public class TreeItemDragBehavior : Behavior<IControl>
{ {
_enableDrag = true; _enableDrag = true;
_dragStarted = false; _dragStarted = false;
_start = e.GetPosition(AssociatedObject.Parent); _start = e.GetPosition(AssociatedObject.Parent as Visual);
_draggedIndex = -1; _draggedIndex = -1;
_targetIndex = -1; _targetIndex = -1;
_itemsControl = itemsControl; _itemsControl = itemsControl;
_draggedContainer = AssociatedObject; _draggedContainer = AssociatedObject;
if (_draggedContainer is { }) if (_draggedContainer is not null)
SetDraggingPseudoClasses(_draggedContainer, true); SetDraggingPseudoClasses(_draggedContainer, true);
AddTransforms(_itemsControl); AddTransforms(_itemsControl);
} }
} }
private void Released(object? sender, PointerReleasedEventArgs e) private void ReleasedHandler(object? sender, PointerReleasedEventArgs e)
{ {
if (_dragStarted) if (_dragStarted)
{ {
@ -125,7 +124,7 @@ public class TreeItemDragBehavior : Behavior<IControl>
} }
} }
private void CaptureLost(object? sender, PointerCaptureLostEventArgs e) private void CaptureLostHandler(object? sender, PointerCaptureLostEventArgs e)
{ {
Released(); Released();
} }
@ -137,19 +136,21 @@ public class TreeItemDragBehavior : Behavior<IControl>
RemoveTransforms(_itemsControl); RemoveTransforms(_itemsControl);
if (_itemsControl is { }) if (_itemsControl is not null)
foreach (ItemContainerInfo? container in _itemsControl.ItemContainerGenerator.Containers) {
SetDraggingPseudoClasses(container.ContainerControl, true); for (int i = 0; i < _itemsControl.ItemCount; i++)
SetDraggingPseudoClasses(_itemsControl.ContainerFromIndex(i), true);
}
if (_dragStarted) if (_dragStarted)
if (_draggedIndex >= 0 && _targetIndex >= 0 && _draggedIndex != _targetIndex) if (_draggedIndex >= 0 && _targetIndex >= 0 && _draggedIndex != _targetIndex)
MoveDraggedItem(_itemsControl, _draggedIndex, _targetIndex); MoveDraggedItem(_itemsControl, _draggedIndex, _targetIndex);
if (_itemsControl is { }) if (_itemsControl is not null)
foreach (ItemContainerInfo? container in _itemsControl.ItemContainerGenerator.Containers) for (int i = 0; i < _itemsControl.ItemCount; i++)
SetDraggingPseudoClasses(container.ContainerControl, false); SetDraggingPseudoClasses(_itemsControl.ContainerFromIndex(i), false);
if (_draggedContainer is { }) if (_draggedContainer is not null)
SetDraggingPseudoClasses(_draggedContainer, false); SetDraggingPseudoClasses(_draggedContainer, false);
_draggedIndex = -1; _draggedIndex = -1;
@ -170,7 +171,7 @@ public class TreeItemDragBehavior : Behavior<IControl>
foreach (object? _ in itemsControl.Items) foreach (object? _ in itemsControl.Items)
{ {
IControl? container = itemsControl.ItemContainerGenerator.ContainerFromIndex(i); Control? container = itemsControl.ContainerFromIndex(i);
if (container is not null) if (container is not null)
SetTranslateTransform(container, 0, 0); SetTranslateTransform(container, 0, 0);
@ -187,7 +188,7 @@ public class TreeItemDragBehavior : Behavior<IControl>
foreach (object? _ in itemsControl.Items) foreach (object? _ in itemsControl.Items)
{ {
IControl? container = itemsControl.ItemContainerGenerator.ContainerFromIndex(i); Control? container = itemsControl.ContainerFromIndex(i);
if (container is not null) if (container is not null)
SetTranslateTransform(container, 0, 0); SetTranslateTransform(container, 0, 0);
@ -208,7 +209,7 @@ public class TreeItemDragBehavior : Behavior<IControl>
selectingItemsControl.SelectedIndex = targetIndex; selectingItemsControl.SelectedIndex = targetIndex;
} }
private void Moved(object? sender, PointerEventArgs e) private void MovedHandler(object? sender, PointerEventArgs e)
{ {
PointerPointProperties properties = e.GetCurrentPoint(AssociatedObject).Properties; PointerPointProperties properties = e.GetCurrentPoint(AssociatedObject).Properties;
if (properties.IsLeftButtonPressed) if (properties.IsLeftButtonPressed)
@ -249,7 +250,7 @@ public class TreeItemDragBehavior : Behavior<IControl>
else else
SetTranslateTransform(_draggedContainer, 0, delta); SetTranslateTransform(_draggedContainer, 0, delta);
_draggedIndex = _itemsControl.ItemContainerGenerator.IndexFromContainer(_draggedContainer); _draggedIndex = _itemsControl.IndexFromContainer(_draggedContainer);
_targetIndex = -1; _targetIndex = -1;
Rect draggedBounds = _draggedContainer.Bounds; Rect draggedBounds = _draggedContainer.Bounds;
@ -268,7 +269,7 @@ public class TreeItemDragBehavior : Behavior<IControl>
foreach (object? _ in _itemsControl.Items) foreach (object? _ in _itemsControl.Items)
{ {
IControl? targetContainer = _itemsControl.ItemContainerGenerator.ContainerFromIndex(i); Control? targetContainer = _itemsControl.ContainerFromIndex(i);
if (targetContainer?.RenderTransform is null || ReferenceEquals(targetContainer, _draggedContainer)) if (targetContainer?.RenderTransform is null || ReferenceEquals(targetContainer, _draggedContainer))
{ {
i++; i++;
@ -321,16 +322,20 @@ public class TreeItemDragBehavior : Behavior<IControl>
} }
} }
private void SetDraggingPseudoClasses(IControl control, bool isDragging) private void SetDraggingPseudoClasses(Control? control, bool isDragging)
{ {
if (control == null)
return;
if (isDragging) if (isDragging)
((IPseudoClasses) control.Classes).Add(":dragging"); ((IPseudoClasses) control.Classes).Add(":dragging");
else else
((IPseudoClasses) control.Classes).Remove(":dragging"); ((IPseudoClasses) control.Classes).Remove(":dragging");
} }
private void SetTranslateTransform(IControl control, double x, double y) private void SetTranslateTransform(Control? control, double x, double y)
{ {
if (control == null)
return;
TransformOperations.Builder transformBuilder = new(1); TransformOperations.Builder transformBuilder = new(1);
transformBuilder.AppendTranslate(x, y); transformBuilder.AppendTranslate(x, y);
control.RenderTransform = transformBuilder.Build(); control.RenderTransform = transformBuilder.Build();

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Globalization;
using Avalonia; using Avalonia;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Media; using Avalonia.Media;
@ -137,47 +138,47 @@ public class TimelineHeader : Control
private void RenderLabel(DrawingContext drawingContext, string text, double x) private void RenderLabel(DrawingContext drawingContext, string text, double x)
{ {
Typeface typeFace = new(FontFamily); Typeface typeFace = new(FontFamily);
FormattedText formattedText = new(text, typeFace, 9, TextAlignment.Left, TextWrapping.NoWrap, Bounds.Size); FormattedText formattedText = new(text, CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeFace, 9, Foreground);
if (x == 0 && OffsetFirstValue) if (x == 0 && OffsetFirstValue)
drawingContext.DrawText(Foreground, new Point(2, 5), formattedText); drawingContext.DrawText(formattedText, new Point(2, 5));
else else
drawingContext.DrawText(Foreground, new Point(x - formattedText.Bounds.Width / 2, 5), formattedText); drawingContext.DrawText(formattedText, new Point(x - formattedText.Width / 2, 5));
} }
private void UpdateTimeScale() private void UpdateTimeScale()
{ {
object[] subds; double[] subds;
if (PixelsPerSecond > 350) if (PixelsPerSecond > 350)
subds = new object[] {12d, 12d, 60d}; subds = new[] {12d, 12d, 60d};
else if (PixelsPerSecond > 250) else if (PixelsPerSecond > 250)
subds = new object[] {6d, 12d, 60d}; subds = new[] {6d, 12d, 60d};
else if (PixelsPerSecond > 200) else if (PixelsPerSecond > 200)
subds = new object[] {6d, 6d, 30d}; subds = new[] {6d, 6d, 30d};
else if (PixelsPerSecond > 150) else if (PixelsPerSecond > 150)
subds = new object[] {4d, 4d, 20d}; subds = new[] {4d, 4d, 20d};
else if (PixelsPerSecond > 140) else if (PixelsPerSecond > 140)
subds = new object[] {4d, 4d, 20d}; subds = new[] {4d, 4d, 20d};
else if (PixelsPerSecond > 90) else if (PixelsPerSecond > 90)
subds = new object[] {2d, 4d, 20d}; subds = new[] {2d, 4d, 20d};
else if (PixelsPerSecond > 60) else if (PixelsPerSecond > 60)
subds = new object[] {2d, 4d, 8d}; subds = new[] {2d, 4d, 8d};
else if (PixelsPerSecond > 40) else if (PixelsPerSecond > 40)
subds = new object[] {1d, 2d, 10d}; subds = new[] {1d, 2d, 10d};
else if (PixelsPerSecond > 30) else if (PixelsPerSecond > 30)
subds = new object[] {1d, 2d, 10d}; subds = new[] {1d, 2d, 10d};
else if (PixelsPerSecond > 10) else if (PixelsPerSecond > 10)
subds = new object[] {1d / 2d, 1d / 2d, 1d / 2d}; subds = new[] {1d / 2d, 1d / 2d, 1d / 2d};
else if (PixelsPerSecond > 4) else if (PixelsPerSecond > 4)
subds = new object[] {1d / 5d, 1d / 5d, 1d / 5d}; subds = new[] {1d / 5d, 1d / 5d, 1d / 5d};
else if (PixelsPerSecond > 3) else if (PixelsPerSecond > 3)
subds = new object[] {1d / 10d, 1d / 10d, 1d / 5d}; subds = new[] {1d / 10d, 1d / 10d, 1d / 5d};
else if (PixelsPerSecond > 1) else if (PixelsPerSecond > 1)
subds = new object[] {1d / 20d, 1d / 20d, 1d / 10d}; subds = new[] {1d / 20d, 1d / 20d, 1d / 10d};
else if (PixelsPerSecond >= 1) else if (PixelsPerSecond >= 1)
subds = new object[] {1d / 30d, 1d / 30d, 1d / 15d}; subds = new[] {1d / 30d, 1d / 30d, 1d / 15d};
else else
// 1s per pixel // 1s per pixel
subds = new object[] {1d / 60d, 1d / 60d, 1d / 15d}; subds = new[] {1d / 60d, 1d / 60d, 1d / 15d};
_subd1 = (double) subds[0]; // big ticks / labels _subd1 = (double) subds[0]; // big ticks / labels
_subd2 = (double) subds[1]; // medium ticks _subd2 = (double) subds[1]; // medium ticks

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class BoolPropertyInputView : ReactiveUserControl<BoolPropertyInputViewModel> public partial class BoolPropertyInputView : ReactiveUserControl<BoolPropertyInputViewModel>
{ {
public BoolPropertyInputView() public BoolPropertyInputView()
{ {

View File

@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class BrushPropertyInputView : ReactiveUserControl<BrushPropertyInputViewModel> public partial class BrushPropertyInputView : ReactiveUserControl<BrushPropertyInputViewModel>
{ {
public BrushPropertyInputView() public BrushPropertyInputView()
{ {

View File

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Reactive.Disposables;
using System.Reactive.Linq; using System.Reactive.Linq;
using Artemis.Core; using Artemis.Core;
using Artemis.Core.LayerBrushes; using Artemis.Core.LayerBrushes;
@ -11,7 +12,6 @@ using Artemis.UI.Shared.Services.Builders;
using Artemis.UI.Shared.Services.ProfileEditor; using Artemis.UI.Shared.Services.ProfileEditor;
using Artemis.UI.Shared.Services.ProfileEditor.Commands; using Artemis.UI.Shared.Services.ProfileEditor.Commands;
using Artemis.UI.Shared.Services.PropertyInput; using Artemis.UI.Shared.Services.PropertyInput;
using Avalonia.Controls.Mixins;
using Avalonia.Threading; using Avalonia.Threading;
using ReactiveUI; using ReactiveUI;

View File

@ -5,7 +5,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class ColorGradientPropertyInputView : ReactiveUserControl<ColorGradientPropertyInputViewModel> public partial class ColorGradientPropertyInputView : ReactiveUserControl<ColorGradientPropertyInputViewModel>
{ {
public ColorGradientPropertyInputView() public ColorGradientPropertyInputView()
{ {

View File

@ -4,7 +4,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class EnumPropertyInputView : ReactiveUserControl<PropertyInputViewModel> public partial class EnumPropertyInputView : ReactiveUserControl<PropertyInputViewModel>
{ {
public EnumPropertyInputView() public EnumPropertyInputView()
{ {

View File

@ -5,7 +5,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class FloatPropertyInputView : ReactiveUserControl<FloatPropertyInputViewModel> public partial class FloatPropertyInputView : ReactiveUserControl<FloatPropertyInputViewModel>
{ {
public FloatPropertyInputView() public FloatPropertyInputView()
{ {

View File

@ -5,7 +5,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class FloatRangePropertyInputView : ReactiveUserControl<FloatRangePropertyInputViewModel> public partial class FloatRangePropertyInputView : ReactiveUserControl<FloatRangePropertyInputViewModel>
{ {
public FloatRangePropertyInputView() public FloatRangePropertyInputView()
{ {

View File

@ -5,7 +5,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class IntPropertyInputView : ReactiveUserControl<IntPropertyInputViewModel> public partial class IntPropertyInputView : ReactiveUserControl<IntPropertyInputViewModel>
{ {
public IntPropertyInputView() public IntPropertyInputView()
{ {

View File

@ -5,7 +5,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class IntRangePropertyInputView : ReactiveUserControl<IntRangePropertyInputViewModel> public partial class IntRangePropertyInputView : ReactiveUserControl<IntRangePropertyInputViewModel>
{ {
public IntRangePropertyInputView() public IntRangePropertyInputView()
{ {

View File

@ -5,7 +5,7 @@ using FluentAvalonia.UI.Controls;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class SKColorPropertyInputView : ReactiveUserControl<SKColorPropertyInputViewModel> public partial class SKColorPropertyInputView : ReactiveUserControl<SKColorPropertyInputViewModel>
{ {
public SKColorPropertyInputView() public SKColorPropertyInputView()
{ {

View File

@ -5,7 +5,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class SKPointPropertyInputView : ReactiveUserControl<SKPointPropertyInputViewModel> public partial class SKPointPropertyInputView : ReactiveUserControl<SKPointPropertyInputViewModel>
{ {
public SKPointPropertyInputView() public SKPointPropertyInputView()
{ {

View File

@ -5,7 +5,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class SKSizePropertyInputView : ReactiveUserControl<SKSizePropertyInputViewModel> public partial class SKSizePropertyInputView : ReactiveUserControl<SKSizePropertyInputViewModel>
{ {
public SKSizePropertyInputView() public SKSizePropertyInputView()
{ {

View File

@ -4,7 +4,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.DefaultTypes.PropertyInput; namespace Artemis.UI.DefaultTypes.PropertyInput;
public class StringPropertyInputView : ReactiveUserControl<FloatPropertyInputViewModel> public partial class StringPropertyInputView : ReactiveUserControl<FloatPropertyInputViewModel>
{ {
public StringPropertyInputView() public StringPropertyInputView()
{ {

View File

@ -13,7 +13,7 @@ using ReactiveUI;
namespace Artemis.UI; namespace Artemis.UI;
public class MainWindow : ReactiveCoreWindow<RootViewModel> public class MainWindow : ReactiveAppWindow<RootViewModel>
{ {
private readonly Panel _rootPanel; private readonly Panel _rootPanel;
private readonly ContentControl _sidebarContentControl; private readonly ContentControl _sidebarContentControl;

View File

@ -10,7 +10,7 @@ using ReactiveUI;
namespace Artemis.UI.Screens.Debugger; namespace Artemis.UI.Screens.Debugger;
public class DebugView : ReactiveCoreWindow<DebugViewModel> public class DebugView : ReactiveAppWindow<DebugViewModel>
{ {
public DebugView() public DebugView()
{ {

View File

@ -7,7 +7,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.Device; namespace Artemis.UI.Screens.Device;
public class DevicePropertiesView : ReactiveCoreWindow<DevicePropertiesViewModel> public class DevicePropertiesView : ReactiveAppWindow<DevicePropertiesViewModel>
{ {
public DevicePropertiesView() public DevicePropertiesView()
{ {

View File

@ -8,7 +8,7 @@ using ReactiveUI;
namespace Artemis.UI.Screens.Plugins; namespace Artemis.UI.Screens.Plugins;
public class PluginSettingsWindowView : ReactiveCoreWindow<PluginSettingsWindowViewModel> public class PluginSettingsWindowView : ReactiveAppWindow<PluginSettingsWindowViewModel>
{ {
public PluginSettingsWindowView() public PluginSettingsWindowView()
{ {

View File

@ -4,7 +4,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs; namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs;
public class LayerHintsDialogView : ReactiveCoreWindow<LayerHintsDialogViewModel> public class LayerHintsDialogView : ReactiveAppWindow<LayerHintsDialogViewModel>
{ {
public LayerHintsDialogView() public LayerHintsDialogView()
{ {

View File

@ -5,7 +5,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Windows; namespace Artemis.UI.Screens.ProfileEditor.Properties.Windows;
public class BrushConfigurationWindowView : ReactiveCoreWindow<BrushConfigurationWindowViewModel> public class BrushConfigurationWindowView : ReactiveAppWindow<BrushConfigurationWindowViewModel>
{ {
private bool _canClose; private bool _canClose;

View File

@ -5,7 +5,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.ProfileEditor.Properties.Windows; namespace Artemis.UI.Screens.ProfileEditor.Properties.Windows;
public class EffectConfigurationWindowView : ReactiveCoreWindow<EffectConfigurationWindowViewModel> public class EffectConfigurationWindowView : ReactiveAppWindow<EffectConfigurationWindowViewModel>
{ {
private bool _canClose; private bool _canClose;

View File

@ -5,7 +5,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.Scripting; namespace Artemis.UI.Screens.Scripting;
public class ScriptsDialogView : ReactiveCoreWindow<ScriptsDialogViewModel> public class ScriptsDialogView : ReactiveAppWindow<ScriptsDialogViewModel>
{ {
private bool _canClose; private bool _canClose;

View File

@ -8,7 +8,7 @@ using ReactiveUI;
namespace Artemis.UI.Screens.Sidebar; namespace Artemis.UI.Screens.Sidebar;
public class ProfileConfigurationEditView : ReactiveCoreWindow<ProfileConfigurationEditViewModel> public class ProfileConfigurationEditView : ReactiveAppWindow<ProfileConfigurationEditViewModel>
{ {
public ProfileConfigurationEditView() public ProfileConfigurationEditView()
{ {

View File

@ -11,7 +11,7 @@ using ReactiveUI;
namespace Artemis.UI.Screens.StartupWizard; namespace Artemis.UI.Screens.StartupWizard;
public class StartupWizardView : ReactiveCoreWindow<StartupWizardViewModel> public class StartupWizardView : ReactiveAppWindow<StartupWizardViewModel>
{ {
private readonly Frame _frame; private readonly Frame _frame;

View File

@ -4,7 +4,7 @@ using Avalonia.Markup.Xaml;
namespace Artemis.UI.Screens.VisualScripting; namespace Artemis.UI.Screens.VisualScripting;
public class NodeScriptWindowView : ReactiveCoreWindow<NodeScriptWindowViewModel> public class NodeScriptWindowView : ReactiveAppWindow<NodeScriptWindowViewModel>
{ {
public NodeScriptWindowView() public NodeScriptWindowView()
{ {

View File

@ -8,14 +8,14 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.18" /> <PackageReference Include="Avalonia" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.18" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.18" /> <PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview6" />
<PackageReference Include="DryIoc.dll" Version="5.3.1" /> <PackageReference Include="DryIoc.dll" Version="5.3.1" />
<PackageReference Include="NoStringEvaluating" Version="2.4.0" /> <PackageReference Include="NoStringEvaluating" Version="2.4.0" />
<PackageReference Include="ReactiveUI" Version="17.1.50" /> <PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="ReactiveUI.Validation" Version="2.2.1" /> <PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />
<PackageReference Include="SkiaSharp" Version="2.88.1-preview.108" /> <PackageReference Include="SkiaSharp" Version="2.88.3" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>