diff --git a/src/AtomUI.Desktop.Controls.ColorPicker/ColorSlider/GradientColorPickerTrack.cs b/src/AtomUI.Desktop.Controls.ColorPicker/ColorSlider/GradientColorPickerTrack.cs index 08afddad8..500861aa3 100644 --- a/src/AtomUI.Desktop.Controls.ColorPicker/ColorSlider/GradientColorPickerTrack.cs +++ b/src/AtomUI.Desktop.Controls.ColorPicker/ColorSlider/GradientColorPickerTrack.cs @@ -13,7 +13,7 @@ internal class GradientColorPickerTrack : AbstractColorPickerSliderTrack GradientColorSlider.GradientValueProperty.AddOwner(); public static readonly StyledProperty ActivatedThumbProperty = - AvaloniaProperty.Register(nameof(ActivatedThumb)); + AvaloniaProperty.Register(nameof(ActivatedThumb)); public LinearGradientBrush? GradientValue { @@ -369,4 +369,4 @@ internal class GradientColorPickerTrack : AbstractColorPickerSliderTrack public void Dispose() => _owner._ignoringPropertyChanged = false; } -} \ No newline at end of file +} diff --git a/tools/performances/AtomUI.Performance/Suites/ColorPicker/ColorPickerStateVerification.cs b/tools/performances/AtomUI.Performance/Suites/ColorPicker/ColorPickerStateVerification.cs index 813741ae7..81be9d75a 100644 --- a/tools/performances/AtomUI.Performance/Suites/ColorPicker/ColorPickerStateVerification.cs +++ b/tools/performances/AtomUI.Performance/Suites/ColorPicker/ColorPickerStateVerification.cs @@ -14,6 +14,7 @@ internal static partial class Program VerifyColorPickerHoverIgnoresClickHandler(failures); VerifyColorPickerFocusTrigger(failures); VerifyColorPickerTriggerSubscriptionLifecycle(failures); + VerifyGradientColorPickerTrackPropertyOwner(failures); if (failures.Count == 0) { @@ -99,6 +100,19 @@ internal static partial class Program failures); } + private static void VerifyGradientColorPickerTrackPropertyOwner(ICollection failures) + { + var trackType = Type.GetType( + "AtomUI.Desktop.Controls.GradientColorPickerTrack, AtomUI.Desktop.Controls.ColorPicker"); + var property = trackType? + .GetField("ActivatedThumbProperty", BindingFlags.Public | BindingFlags.Static)? + .GetValue(null) as Avalonia.AvaloniaProperty; + + Expect(trackType is not null && property?.OwnerType == trackType, + $"GradientColorPickerTrack.ActivatedThumbProperty should be registered on GradientColorPickerTrack. Actual owner: {property?.OwnerType.FullName ?? ""}.", + failures); + } + private static bool GetColorPickerIsOpen(AbstractColorPicker picker) => GetColorPickerProperty(picker, "IsPickerOpen");