mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Fixed compile errors in Artemis.UI
This commit is contained in:
1 parent
81e83e59f6
commit
d171b947b7
160 files changed
+407
-521
No files matched your search
@@ -12,10 +12,12 @@ public class SidebarCategoryViewDropHandler : DropHandlerBase
|
||||
public override bool Validate(object? sender, DragEventArgs e, object? sourceContext, object? targetContext, object? state)
|
||||
{
|
||||
if (sender is ItemsControl itemsControl)
|
||||
foreach (ItemContainerInfo? item in itemsControl.ItemContainerGenerator.Containers)
|
||||
SetDraggingPseudoClasses(item.ContainerControl, false, false);
|
||||
{
|
||||
foreach (Control container in itemsControl.GetRealizedContainers())
|
||||
SetDraggingPseudoClasses(container, false, false);
|
||||
}
|
||||
|
||||
if (e.Source is IControl && sender is ListBox listBox)
|
||||
if (e.Source is Control && sender is ListBox listBox)
|
||||
return Validate(listBox, e, sourceContext, targetContext, false);
|
||||
|
||||
return false;
|
||||
@@ -24,10 +26,12 @@ public class SidebarCategoryViewDropHandler : DropHandlerBase
|
||||
public override bool Execute(object? sender, DragEventArgs e, object? sourceContext, object? targetContext, object? state)
|
||||
{
|
||||
if (sender is ItemsControl itemsControl)
|
||||
foreach (ItemContainerInfo? item in itemsControl.ItemContainerGenerator.Containers)
|
||||
SetDraggingPseudoClasses(item.ContainerControl, false, false);
|
||||
{
|
||||
foreach (Control container in itemsControl.GetRealizedContainers())
|
||||
SetDraggingPseudoClasses(container, false, false);
|
||||
}
|
||||
|
||||
if (e.Source is IControl && sender is ListBox listBox)
|
||||
if (e.Source is Control && sender is ListBox listBox)
|
||||
return Validate(listBox, e, sourceContext, targetContext, true);
|
||||
|
||||
return false;
|
||||
@@ -36,7 +40,7 @@ public class SidebarCategoryViewDropHandler : DropHandlerBase
|
||||
private bool Validate(ListBox listBox, DragEventArgs e, object? sourceContext, object? targetContext, bool bExecute)
|
||||
{
|
||||
if (sourceContext is not SidebarProfileConfigurationViewModel sourceItem || targetContext is not SidebarCategoryViewModel vm ||
|
||||
listBox.GetVisualAt(e.GetPosition(listBox)) is not IControl targetControl)
|
||||
listBox.GetVisualAt(e.GetPosition(listBox)) is not Control targetControl)
|
||||
return false;
|
||||
if (e.DragEffects != DragDropEffects.Move)
|
||||
return false;
|
||||
@@ -55,9 +59,9 @@ public class SidebarCategoryViewDropHandler : DropHandlerBase
|
||||
before = false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (ItemContainerInfo? item in listBox.ItemContainerGenerator.Containers)
|
||||
SetDraggingPseudoClasses(item.ContainerControl, false, false);
|
||||
|
||||
foreach (Control container in listBox.GetRealizedContainers())
|
||||
SetDraggingPseudoClasses(container, false, false);
|
||||
|
||||
if (bExecute)
|
||||
{
|
||||
@@ -81,8 +85,11 @@ public class SidebarCategoryViewDropHandler : DropHandlerBase
|
||||
return true;
|
||||
}
|
||||
|
||||
private void SetDraggingPseudoClasses(IControl control, bool dragging, bool before)
|
||||
private void SetDraggingPseudoClasses(Control? control, bool dragging, bool before)
|
||||
{
|
||||
if (control == null)
|
||||
return;
|
||||
|
||||
if (!dragging)
|
||||
{
|
||||
((IPseudoClasses) control.Classes).Remove(":dragging");
|
||||
|
||||
@@ -5,7 +5,7 @@ using ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar;
|
||||
|
||||
public class SidebarCategoryEditView : ReactiveUserControl<SidebarCategoryEditViewModel>
|
||||
public partial class SidebarCategoryEditView : ReactiveUserControl<SidebarCategoryEditViewModel>
|
||||
{
|
||||
public SidebarCategoryEditView()
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar;
|
||||
|
||||
public class ModuleActivationRequirementView : ReactiveUserControl<ModuleActivationRequirementViewModel>
|
||||
public partial class ModuleActivationRequirementView : ReactiveUserControl<ModuleActivationRequirementViewModel>
|
||||
{
|
||||
public ModuleActivationRequirementView()
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar;
|
||||
|
||||
public class ModuleActivationRequirementsView : UserControl
|
||||
public partial class ModuleActivationRequirementsView : UserControl
|
||||
{
|
||||
public ModuleActivationRequirementsView()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<controls1:CoreWindow xmlns="https://github.com/avaloniaui"
|
||||
<windowing:AppWindow xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
@@ -6,8 +6,8 @@
|
||||
xmlns:converters="clr-namespace:Artemis.UI.Shared.Converters;assembly=Artemis.UI.Shared"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.Sidebar"
|
||||
xmlns:controls1="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
||||
xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
|
||||
xmlns:windowing="clr-namespace:FluentAvalonia.UI.Windowing;assembly=FluentAvalonia"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="850"
|
||||
x:Class="Artemis.UI.Screens.Sidebar.ProfileConfigurationEditView"
|
||||
x:DataType="local:ProfileConfigurationEditViewModel"
|
||||
@@ -106,7 +106,6 @@
|
||||
</Border>
|
||||
<ComboBox Items="{CompiledBinding MaterialIcons}"
|
||||
SelectedItem="{CompiledBinding SelectedMaterialIcon}"
|
||||
VirtualizationMode="Simple"
|
||||
VerticalAlignment="Bottom"
|
||||
IsTextSearchEnabled="True"
|
||||
Margin="10 0"
|
||||
@@ -197,4 +196,4 @@
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
</controls1:CoreWindow>
|
||||
</windowing:AppWindow>
|
||||
@@ -8,12 +8,12 @@ using ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar;
|
||||
|
||||
public class ProfileConfigurationEditView : ReactiveAppWindow<ProfileConfigurationEditViewModel>
|
||||
public partial class ProfileConfigurationEditView : ReactiveAppWindow<ProfileConfigurationEditViewModel>
|
||||
{
|
||||
public ProfileConfigurationEditView()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.WhenActivated(d => ViewModel.WhenAnyValue(vm => vm.SelectedBitmapSource).Subscribe(_ => this.Get<Border>("FillPreview").InvalidateVisual()).DisposeWith(d));
|
||||
this.WhenActivated(d => ViewModel.WhenAnyValue(vm => vm.SelectedBitmapSource).Subscribe(_ => FillPreview.InvalidateVisual()).DisposeWith(d));
|
||||
|
||||
#if DEBUG
|
||||
this.AttachDevTools();
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:local="clr-namespace:Artemis.UI.Screens.Sidebar"
|
||||
xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
|
||||
xmlns:idd="clr-namespace:Avalonia.Xaml.Interactions.DragAndDrop;assembly=Avalonia.Xaml.Interactions"
|
||||
xmlns:sb="clr-namespace:Artemis.UI.Screens.Sidebar.Behaviors"
|
||||
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
||||
xmlns:b="clr-namespace:Artemis.UI.Behaviors"
|
||||
@@ -93,7 +92,7 @@
|
||||
<Setter Property="(i:Interaction.Behaviors)">
|
||||
<i:BehaviorCollectionTemplate>
|
||||
<i:BehaviorCollection>
|
||||
<idd:ContextDropBehavior Handler="{StaticResource SidebarCategoryViewDropHandler}" />
|
||||
<ContextDropBehavior Handler="{StaticResource SidebarCategoryViewDropHandler}" />
|
||||
</i:BehaviorCollection>
|
||||
</i:BehaviorCollectionTemplate>
|
||||
</Setter>
|
||||
|
||||
@@ -14,21 +14,18 @@ using Avalonia.VisualTree;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar;
|
||||
|
||||
public class SidebarCategoryView : ReactiveUserControl<SidebarCategoryViewModel>
|
||||
public partial class SidebarCategoryView : ReactiveUserControl<SidebarCategoryViewModel>
|
||||
{
|
||||
private static Image? _dragAdorner;
|
||||
private Point _dragStartPosition;
|
||||
private Point _elementDragOffset;
|
||||
private ListBox _listBox;
|
||||
|
||||
public SidebarCategoryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
_listBox = this.Get<ListBox>("SidebarListBox");
|
||||
|
||||
AddHandler(DragDrop.DragEnterEvent, HandleDragEnterEvent, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
|
||||
AddHandler(DragDrop.DragOverEvent, HandleDragOver, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
|
||||
AddHandler(PointerEnterEvent, HandlePointerEnter, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
|
||||
AddHandler(PointerEnteredEvent, HandlePointerEnter, RoutingStrategies.Direct | RoutingStrategies.Tunnel | RoutingStrategies.Bubble, true);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
|
||||
@@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar;
|
||||
|
||||
public class SidebarProfileConfigurationView : ReactiveUserControl<SidebarProfileConfigurationViewModel>
|
||||
public partial class SidebarProfileConfigurationView : ReactiveUserControl<SidebarProfileConfigurationViewModel>
|
||||
{
|
||||
public SidebarProfileConfigurationView()
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar;
|
||||
|
||||
public class SidebarScreenView : UserControl
|
||||
public partial class SidebarScreenView : UserControl
|
||||
{
|
||||
public SidebarScreenView()
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@ using Avalonia.ReactiveUI;
|
||||
|
||||
namespace Artemis.UI.Screens.Sidebar;
|
||||
|
||||
public class SidebarView : ReactiveUserControl<SidebarViewModel>
|
||||
public partial class SidebarView : ReactiveUserControl<SidebarViewModel>
|
||||
{
|
||||
public SidebarView()
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ using Artemis.UI.Shared;
|
||||
using Artemis.UI.Shared.Services;
|
||||
using Artemis.UI.Shared.Services.Builders;
|
||||
using Artemis.UI.Shared.Services.ProfileEditor;
|
||||
using Avalonia.Threading;
|
||||
using Avalonia.ReactiveUI;
|
||||
using DryIoc;
|
||||
using DynamicData;
|
||||
using DynamicData.Binding;
|
||||
|
||||
Reference in new issue
Block a user