mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 20:06:33 +00:00
Layers - Seperated activation and removal of layers/effects
Effects - Added effects UI, order is still a bit messed up and reordering is missed Effects - Added renaming of effects on the layer
This commit is contained in:
1 parent
692cf806b7
commit
18593853d8
39 files changed
+691
-334
No files matched your search
@@ -0,0 +1,39 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace Artemis.UI.Behaviors
|
||||
{
|
||||
public class MouseBehaviour
|
||||
{
|
||||
public static readonly DependencyProperty MouseUpCommandProperty =
|
||||
DependencyProperty.RegisterAttached("MouseUpCommand", typeof(ICommand),
|
||||
typeof(MouseBehaviour), new FrameworkPropertyMetadata(
|
||||
MouseUpCommandChanged));
|
||||
|
||||
public static void SetMouseUpCommand(UIElement element, ICommand value)
|
||||
{
|
||||
element.SetValue(MouseUpCommandProperty, value);
|
||||
}
|
||||
|
||||
public static ICommand GetMouseUpCommand(UIElement element)
|
||||
{
|
||||
return (ICommand) element.GetValue(MouseUpCommandProperty);
|
||||
}
|
||||
|
||||
private static void MouseUpCommandChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var element = (FrameworkElement) d;
|
||||
|
||||
element.MouseUp += element_MouseUp;
|
||||
}
|
||||
|
||||
private static void element_MouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
var element = (FrameworkElement) sender;
|
||||
|
||||
var command = GetMouseUpCommand(element);
|
||||
|
||||
command.Execute(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user