mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
36 lines
1.3 KiB
C#
36 lines
1.3 KiB
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
using Stylet;
|
|
|
|
namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Tree
|
|
{
|
|
public class TreeViewModel : Screen
|
|
{
|
|
public TreeViewModel(LayerPropertiesViewModel layerPropertiesViewModel, BindableCollection<LayerPropertyGroupViewModel> layerPropertyGroups)
|
|
{
|
|
LayerPropertiesViewModel = layerPropertiesViewModel;
|
|
|
|
// Not using the Items collection because the list should persist even after this VM gets closed
|
|
LayerPropertyGroups = layerPropertyGroups;
|
|
}
|
|
|
|
public LayerPropertiesViewModel LayerPropertiesViewModel { get; }
|
|
public BindableCollection<LayerPropertyGroupViewModel> LayerPropertyGroups { get; }
|
|
|
|
public void PropertyTreePreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
|
{
|
|
if (e.Handled || !(sender is System.Windows.Controls.TreeView))
|
|
return;
|
|
|
|
e.Handled = true;
|
|
var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta)
|
|
{
|
|
RoutedEvent = UIElement.MouseWheelEvent,
|
|
Source = sender
|
|
};
|
|
var parent = ((Control) sender).Parent as UIElement;
|
|
parent?.RaiseEvent(eventArg);
|
|
}
|
|
}
|
|
} |