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");
|
||||
|
||||
Reference in new issue
Block a user