1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Upgraded to preview8

This commit is contained in:
Robert 2023-05-11 23:10:40 +02:00
parent 3c6d770ec2
commit bf6674e44f
24 changed files with 117 additions and 113 deletions

View File

@ -35,7 +35,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="DryIoc.dll" Version="5.3.4" />
<PackageReference Include="DryIoc.dll" Version="5.4.0" />
<PackageReference Include="EmbedIO" Version="3.5.2" />
<PackageReference Include="HidSharp" Version="2.1.0" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />

View File

@ -16,11 +16,11 @@
<None Remove=".gitignore" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="ReactiveUI" Version="18.4.26" />
</ItemGroup>
<ItemGroup>

View File

@ -15,11 +15,11 @@
<None Remove=".gitignore" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="ReactiveUI" Version="18.4.26" />
</ItemGroup>
<ItemGroup>

View File

@ -10,13 +10,13 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview7" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview8" />
<PackageReference Include="DynamicData" Version="7.13.1" />
<PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview7.1" />
<PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview8" />
<PackageReference Include="Material.Icons.Avalonia" Version="2.0.0-preview3" />
<PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />

View File

@ -64,7 +64,7 @@ public partial class ArtemisIcon : UserControl
Background = TextElement.GetForeground(this),
VerticalAlignment = VerticalAlignment.Stretch,
HorizontalAlignment = HorizontalAlignment.Stretch,
OpacityMask = new ImageBrush(new Bitmap(iconString)) {BitmapInterpolationMode = BitmapInterpolationMode.MediumQuality}
OpacityMask = new ImageBrush(new Bitmap(iconString))
};
}
else

View File

@ -67,8 +67,7 @@ public class DeviceVisualizer : Control
drawingContext.DrawImage(
_deviceImage,
new Rect(_deviceImage.Size),
new Rect(0, 0, Device.RgbDevice.ActualSize.Width, Device.RgbDevice.ActualSize.Height),
RenderOptions.GetBitmapInterpolationMode(this)
new Rect(0, 0, Device.RgbDevice.ActualSize.Width, Device.RgbDevice.ActualSize.Height)
);
if (!ShowColors)
@ -306,8 +305,8 @@ public class DeviceVisualizer : Control
using DrawingContext context = renderTargetBitmap.CreateDrawingContext();
using Bitmap bitmap = new(device.Layout.Image.LocalPath);
context.DrawImage(bitmap, new Rect(bitmap.Size), new Rect(renderTargetBitmap.Size), BitmapInterpolationMode.HighQuality);
context.DrawImage(bitmap, new Rect(bitmap.Size), new Rect(renderTargetBitmap.Size));
lock (_deviceVisualizerLeds)
{
foreach (DeviceVisualizerLed deviceVisualizerLed in _deviceVisualizerLeds)

View File

@ -49,8 +49,7 @@ internal class DeviceVisualizerLed
drawingContext.DrawImage(
bitmap,
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),
BitmapInterpolationMode.HighQuality
new Rect(Led.RgbLed.Location.X * scale, Led.RgbLed.Location.Y * scale, Led.RgbLed.Size.Width * scale, Led.RgbLed.Size.Height * scale)
);
}
catch

View File

@ -75,7 +75,7 @@ public partial class ProfileConfigurationIcon : UserControl, IDisposable
Background = TextElement.GetForeground(this),
VerticalAlignment = VerticalAlignment.Stretch,
HorizontalAlignment = HorizontalAlignment.Stretch,
OpacityMask = new ImageBrush(new Bitmap(stream)) {BitmapInterpolationMode = BitmapInterpolationMode.MediumQuality}
OpacityMask = new ImageBrush(new Bitmap(stream))
};
}

View File

@ -21,12 +21,12 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.Win32" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Win32" Version="11.0.0-preview8" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<PackageReference Include="Microsoft.Win32" Version="2.0.1" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.0" />

View File

@ -16,12 +16,6 @@ public class AutoRunProvider : IAutoRunProvider
{
private readonly string _autorunName = $"Artemis 2 autorun {Environment.UserName}";
private readonly string _oldAutorunName = "Artemis 2 autorun";
private readonly IAssetLoader _assetLoader;
public AutoRunProvider(IAssetLoader assetLoader)
{
_assetLoader = assetLoader;
}
private async Task<bool> IsAutoRunTaskCreated(string autorunName)
{
@ -43,7 +37,7 @@ public class AutoRunProvider : IAutoRunProvider
private async Task CreateAutoRunTask(TimeSpan autoRunDelay, string autorunName)
{
await using Stream taskFile = _assetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/autorun.xml"));
await using Stream taskFile = AssetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/autorun.xml"));
XDocument document = await XDocument.LoadAsync(taskFile, LoadOptions.None, CancellationToken.None);
XElement task = document.Descendants().First();

View File

@ -9,11 +9,11 @@ namespace Artemis.UI.Windows.Providers;
public class CursorProvider : ICursorProvider
{
public CursorProvider(IAssetLoader assetLoader)
public CursorProvider()
{
Rotate = new Cursor(new Bitmap(assetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_rotate.png"))), new PixelPoint(21, 10));
Drag = new Cursor(new Bitmap(assetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_drag.png"))), new PixelPoint(11, 3));
DragHorizontal = new Cursor(new Bitmap(assetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_drag_horizontal.png"))), new PixelPoint(16, 5));
Rotate = new Cursor(new Bitmap(AssetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_rotate.png"))), new PixelPoint(21, 10));
Drag = new Cursor(new Bitmap(AssetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_drag.png"))), new PixelPoint(11, 3));
DragHorizontal = new Cursor(new Bitmap(AssetLoader.Open(new Uri("avares://Artemis.UI.Windows/Assets/Cursors/aero_drag_horizontal.png"))), new PixelPoint(16, 5));
}
public Cursor Rotate { get; }

View File

@ -15,17 +15,17 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.0.0-preview6" />
<PackageReference Include="Avalonia.Controls.Skia" Version="11.0.0-preview7" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Controls.Skia" Version="11.0.0-preview8.1" />
<PackageReference Include="Avalonia.Desktop" Version="11.0.0-preview8" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview7" />
<PackageReference Include="DryIoc.dll" Version="5.3.4" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview8" />
<PackageReference Include="DryIoc.dll" Version="5.4.0" />
<PackageReference Include="DynamicData" Version="7.13.1" />
<PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview7.1" />
<PackageReference Include="FluentAvaloniaUI" Version="2.0.0-preview8" />
<PackageReference Include="Flurl.Http" Version="3.2.4" />
<PackageReference Include="Live.Avalonia" Version="1.3.1" />
<PackageReference Include="Markdown.Avalonia.Tight" Version="11.0.0-b1" />

View File

@ -7,7 +7,6 @@ using Artemis.UI.Services.Updating;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.Services.ProfileEditor;
using Avalonia.Platform;
using DryIoc;
namespace Artemis.UI.DryIoc;
@ -25,10 +24,7 @@ public static class ContainerExtensions
{
Assembly[] thisAssembly = {typeof(ContainerExtensions).Assembly};
container.RegisterInstance(new AssetLoader(), IfAlreadyRegistered.Throw);
container.Register<IAssetLoader, AssetLoader>(Reuse.Singleton);
container.RegisterMany(thisAssembly, type => type.IsAssignableTo<ViewModelBase>());
container.RegisterMany(thisAssembly, type => type.IsAssignableTo<ViewModelBase>(), setup: Setup.With(preventDisposal: true));
container.RegisterMany(thisAssembly, type => type.IsAssignableTo<IToolViewModel>() && type.IsInterface);
container.RegisterMany(thisAssembly, type => type.IsAssignableTo<IVmFactory>() && type != typeof(PropertyVmFactory));

View File

@ -6,7 +6,6 @@ using Artemis.UI.Screens.Root;
using Artemis.UI.Shared;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
using ReactiveUI;
@ -15,10 +14,12 @@ namespace Artemis.UI;
public partial class MainWindow : ReactiveAppWindow<RootViewModel>
{
private bool _activated;
private IDisposable? _positionObserver;
public MainWindow()
{
Opened += OnOpened;
Closed += OnClosed;
Activated += OnActivated;
Deactivated += OnDeactivated;
@ -31,12 +32,6 @@ public partial class MainWindow : ReactiveAppWindow<RootViewModel>
#if DEBUG
this.AttachDevTools();
#endif
Observable.FromEventPattern<PixelPointEventArgs>(x => PositionChanged += x, x => PositionChanged -= x)
.Select(_ => Unit.Default)
.Merge(this.WhenAnyValue(vm => vm.WindowState, vm => vm.Width, vm => vm.Width, vm => vm.Height).Select(_ => Unit.Default))
.Throttle(TimeSpan.FromMilliseconds(200), AvaloniaScheduler.Instance)
.Subscribe(_ => SaveWindowSize());
}
private void ApplyWindowSize()
@ -61,8 +56,18 @@ public partial class MainWindow : ReactiveAppWindow<RootViewModel>
private void OnOpened(object? sender, EventArgs e)
{
Opened -= OnOpened;
TitleBar.ExtendsContentIntoTitleBar = true;
_positionObserver = Observable.FromEventPattern<PixelPointEventArgs>(x => PositionChanged += x, x => PositionChanged -= x)
.Select(_ => Unit.Default)
.Merge(this.WhenAnyValue(vm => vm.WindowState, vm => vm.Width, vm => vm.Width, vm => vm.Height).Select(_ => Unit.Default))
.Throttle(TimeSpan.FromMilliseconds(200), AvaloniaScheduler.Instance)
.Subscribe(_ => SaveWindowSize());
}
private void OnClosed(object? sender, EventArgs e)
{
_positionObserver?.Dispose();
}
private void OnActivated(object? sender, EventArgs e)
@ -74,5 +79,4 @@ public partial class MainWindow : ReactiveAppWindow<RootViewModel>
{
ViewModel?.Unfocused();
}
}

View File

@ -59,7 +59,7 @@ public class PlaybackViewModel : ActivatableViewModelBase
updateTimer.Start();
Disposable.Create(() =>
{
// updateTimer.Stop();
updateTimer.Stop();
_settingsService.GetSetting("ProfileEditor.RepeatTimeline", true).Value = _repeating && _repeatTimeline;
_settingsService.GetSetting("ProfileEditor.RepeatSegment", false).Value = _repeating && _repeatSegment;
}).DisposeWith(d);

View File

@ -179,12 +179,12 @@ public class PropertyGroupViewModel : PropertyViewModelBase, IDisposable
public void Dispose()
{
LayerPropertyGroup.VisibilityChanged -= LayerPropertyGroupOnVisibilityChanged;
foreach (ViewModelBase viewModelBase in Children)
while (Children.Any())
{
if (viewModelBase is IDisposable disposable)
if (Children[0] is IDisposable disposable)
disposable.Dispose();
Children.RemoveAt(0);
}
_keyframeSubscription.Dispose();
}
}

View File

@ -22,7 +22,6 @@ namespace Artemis.UI.Screens.Root;
public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvider
{
private readonly IAssetLoader _assetLoader;
private readonly ICoreService _coreService;
private readonly IDebugService _debugService;
private readonly DefaultTitleBarViewModel _defaultTitleBarViewModel;
@ -41,7 +40,6 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
IMainWindowService mainWindowService,
IDebugService debugService,
IUpdateService updateService,
IAssetLoader assetLoader,
DefaultTitleBarViewModel defaultTitleBarViewModel,
ISidebarVmFactory sidebarVmFactory)
{
@ -53,7 +51,6 @@ public class RootViewModel : ActivatableViewModelBase, IScreen, IMainWindowProvi
_windowService = windowService;
_debugService = debugService;
_updateService = updateService;
_assetLoader = assetLoader;
_defaultTitleBarViewModel = defaultTitleBarViewModel;
_sidebarVmFactory = sidebarVmFactory;
_lifeTime = (IClassicDesktopStyleApplicationLifetime) Application.Current!.ApplicationLifetime!;

View File

@ -11,7 +11,7 @@
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="15" MaxWidth="800">
<Grid RowDefinitions="*,*" ColumnDefinitions="Auto,*,Auto">
<Image Grid.Column="0" Grid.RowSpan="2" Width="65" Height="65" VerticalAlignment="Center" Source="/Assets/Images/Logo/bow.png" Margin="0 0 20 0"/>
<Image Grid.Column="0" Grid.RowSpan="2" Width="65" Height="65" VerticalAlignment="Center" Source="/Assets/Images/Logo/bow.png" Margin="0 0 20 0" />
<TextBlock Grid.Row="0" Grid.Column="1" FontSize="36" VerticalAlignment="Bottom">
Artemis 2
</TextBlock>
@ -52,9 +52,10 @@
Height="75"
Width="75"
Margin="0 0 15 0"
IsVisible="{CompiledBinding RobertProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
IsVisible="{CompiledBinding RobertProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
RenderOptions.BitmapInterpolationMode="HighQuality">
<Ellipse.Fill>
<ImageBrush Source="{CompiledBinding RobertProfileImage}" BitmapInterpolationMode="HighQuality" />
<ImageBrush Source="{CompiledBinding RobertProfileImage}" />
</Ellipse.Fill>
</Ellipse>
<TextBlock Grid.Row="0" Grid.Column="1" Padding="0">
@ -80,9 +81,10 @@
Height="75"
Width="75"
Margin="0 0 15 0"
IsVisible="{CompiledBinding DarthAffeProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
IsVisible="{CompiledBinding DarthAffeProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
RenderOptions.BitmapInterpolationMode="HighQuality">
<Ellipse.Fill>
<ImageBrush Source="{CompiledBinding DarthAffeProfileImage}" BitmapInterpolationMode="HighQuality" />
<ImageBrush Source="{CompiledBinding DarthAffeProfileImage}" />
</Ellipse.Fill>
</Ellipse>
<TextBlock Grid.Row="0" Grid.Column="1" Padding="0">
@ -108,9 +110,10 @@
Height="75"
Width="75"
Margin="0 0 15 0"
IsVisible="{CompiledBinding DrMeteorProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
IsVisible="{CompiledBinding DrMeteorProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
RenderOptions.BitmapInterpolationMode="HighQuality">
<Ellipse.Fill>
<ImageBrush Source="{CompiledBinding DrMeteorProfileImage}" BitmapInterpolationMode="HighQuality" />
<ImageBrush Source="{CompiledBinding DrMeteorProfileImage}" />
</Ellipse.Fill>
</Ellipse>
<TextBlock Grid.Row="0" Grid.Column="1" Padding="0">
@ -136,9 +139,10 @@
Height="75"
Width="75"
Margin="0 0 15 0"
IsVisible="{CompiledBinding KaiProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}">
IsVisible="{CompiledBinding KaiProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
RenderOptions.BitmapInterpolationMode="HighQuality">
<Ellipse.Fill>
<ImageBrush Source="{CompiledBinding KaiProfileImage}" BitmapInterpolationMode="HighQuality" />
<ImageBrush Source="{CompiledBinding KaiProfileImage}" />
</Ellipse.Fill>
</Ellipse>
<TextBlock Grid.Row="0" Grid.Column="1" Padding="0">

View File

@ -79,9 +79,13 @@
<Border IsVisible="{CompiledBinding ProfileConfiguration.Icon.Fill}" Background="{DynamicResource CheckerboardBrush}" CornerRadius="{DynamicResource CardCornerRadius}"
Width="78" Height="78">
<Border Name="FillPreview" Background="{DynamicResource TextFillColorPrimary}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="10">
<Border Name="FillPreview"
Background="{DynamicResource TextFillColorPrimary}"
VerticalAlignment="Stretch"
HorizontalAlignment="Stretch" Margin="10"
RenderOptions.BitmapInterpolationMode="HighQuality" >
<Border.OpacityMask>
<ImageBrush Source="{CompiledBinding SelectedBitmapSource}" BitmapInterpolationMode="HighQuality" />
<ImageBrush Source="{CompiledBinding SelectedBitmapSource}" />
</Border.OpacityMask>
</Border>
</Border>
@ -127,8 +131,9 @@
</ComboBox>
</StackPanel>
<CheckBox VerticalAlignment="Bottom" IsChecked="{CompiledBinding FadeInAndOut}" ToolTip.Tip="Smoothly animates in and out when the profile activation conditions change.">Fade when enabling and disabling</CheckBox>
<CheckBox VerticalAlignment="Bottom" IsChecked="{CompiledBinding FadeInAndOut}" ToolTip.Tip="Smoothly animates in and out when the profile activation conditions change.">
Fade when enabling and disabling
</CheckBox>
</StackPanel>
</Border>

View File

@ -18,11 +18,13 @@ public class NodeMenuItemViewModel
public NodeMenuItemViewModel(ReactiveCommand<NodeData, Unit> createNode, NodeData nodeData)
{
Header = nodeData.Name;
Subtitle = nodeData.Description;
Items = new List<NodeMenuItemViewModel>();
CreateNode = ReactiveCommand.Create(() => { createNode.Execute(nodeData).Subscribe(); });
}
public string Header { get; }
public string? Subtitle { get; }
public List<NodeMenuItemViewModel> Items { get; }
public ReactiveCommand<Unit, Unit>? CreateNode { get; }
}

View File

@ -30,10 +30,21 @@
<MenuItem.Styles>
<Style Selector="MenuItem > MenuItem > MenuItem" x:DataType="visualScripting:NodeMenuItemViewModel">
<Setter Property="Command" Value="{CompiledBinding CreateNode}" />
<Setter Property="Header" Value="{CompiledBinding Header}" />
<Setter Property="ItemsSource" Value="{CompiledBinding Items}" />
</Style>
</MenuItem.Styles>
<MenuItem.DataTemplates>
<DataTemplate DataType="{x:Type visualScripting:NodeMenuItemViewModel}">
<StackPanel Background="Transparent" MaxWidth="300">
<TextBlock Text="{CompiledBinding Header}" TextWrapping="Wrap"></TextBlock>
<TextBlock IsVisible="{CompiledBinding Subtitle, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
Foreground="{DynamicResource TextFillColorSecondary}"
Text="{CompiledBinding Subtitle}"
TextWrapping="Wrap">
</TextBlock>
</StackPanel>
</DataTemplate>
</MenuItem.DataTemplates>
</MenuItem>
<MenuItem Header="Auto-arrange" Command="{CompiledBinding AutoArrange}" InputGesture="Ctrl+F">
<MenuItem.Icon>

View File

@ -8,10 +8,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.999-cibuild0034035-beta" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview7" />
<PackageReference Include="DryIoc.dll" Version="5.3.4" />
<PackageReference Include="Avalonia" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.0-preview8" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.0.0-preview8" />
<PackageReference Include="DryIoc.dll" Version="5.4.0" />
<PackageReference Include="NoStringEvaluating" Version="2.5.2" />
<PackageReference Include="ReactiveUI" Version="18.4.26" />
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />

View File

@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DryIoc.dll" Version="5.3.4" />
<PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.1.1" />
<PackageReference Include="DryIoc.dll" Version="5.4.0" />
<PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="6.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="StrawberryShake.Server" Version="13.0.5" />

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Avalonia" value="https://nuget.avaloniaui.net/repository/avalonia-all/index.json" />
</packageSources>
</configuration>