Skip to content

Commit 76bdb25

Browse files
committed
Refactor into separate method
1 parent 9abeb15 commit 76bdb25

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Avalonia.Xaml.Interactions/Core/DataTriggerBehavior.cs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Diagnostics.CodeAnalysis;
1+
using System;
2+
using System.Diagnostics.CodeAnalysis;
23
using Avalonia.Reactive;
34
using Avalonia.Xaml.Interactivity;
45

@@ -74,6 +75,11 @@ private static void OnValueChanged(AvaloniaPropertyChangedEventArgs args)
7475
return;
7576
}
7677

78+
Execute(behavior, args);
79+
}
80+
81+
private static void Execute(DataTriggerBehavior behavior, object? parameter)
82+
{
7783
if (!behavior.IsEnabled)
7884
{
7985
return;
@@ -86,7 +92,7 @@ private static void OnValueChanged(AvaloniaPropertyChangedEventArgs args)
8692
// Some value has changed--either the binding value, reference value, or the comparison condition. Re-evaluate the equation.
8793
if (ComparisonConditionTypeHelper.Compare(behavior.Binding, behavior.ComparisonCondition, behavior.Value))
8894
{
89-
Interaction.ExecuteActions(behavior.AssociatedObject, behavior.Actions, args);
95+
Interaction.ExecuteActions(behavior.AssociatedObject, behavior.Actions, parameter);
9096
}
9197
}
9298
}

0 commit comments

Comments
 (0)