diff --git a/src/ColorPicker.AvaloniaUI/Behaviors/TextBoxFocusBehavior.cs b/src/ColorPicker.AvaloniaUI/Behaviors/TextBoxFocusBehavior.cs
index ad3b3d0..639843d 100644
--- a/src/ColorPicker.AvaloniaUI/Behaviors/TextBoxFocusBehavior.cs
+++ b/src/ColorPicker.AvaloniaUI/Behaviors/TextBoxFocusBehavior.cs
@@ -72,18 +72,17 @@ private void AssociatedObject_KeyUp(object sender, KeyEventArgs e)
private void RemoveFocus()
{
- var focusManager = TopLevel.GetTopLevel(AssociatedObject).FocusManager;
+ var focusManager = TopLevel.GetTopLevel(AssociatedObject)?.FocusManager;
+ if (focusManager == null) return;
+
var current = focusManager.GetFocusedElement();
if (current != null)
{
- //TODO: Find non obsolete way to do this
- var next = KeyboardNavigationHandler.GetNext(AssociatedObject, NavigationDirection.Next);
- next?.Focus(NavigationMethod.Tab);
+ focusManager.TryMoveFocus(NavigationDirection.Next);
}
}
- private void AssociatedObjectGotKeyboardFocus(
- object sender, GotFocusEventArgs e)
+ private void AssociatedObjectGotKeyboardFocus(object sender, FocusChangedEventArgs e)
{
if (SelectOnMouseClick || e.NavigationMethod == NavigationMethod.Tab)
{
diff --git a/src/ColorPicker.AvaloniaUI/ColorPicker.AvaloniaUI.csproj b/src/ColorPicker.AvaloniaUI/ColorPicker.AvaloniaUI.csproj
index 66cf706..5f05d65 100644
--- a/src/ColorPicker.AvaloniaUI/ColorPicker.AvaloniaUI.csproj
+++ b/src/ColorPicker.AvaloniaUI/ColorPicker.AvaloniaUI.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
enable
disable
true
@@ -31,8 +31,8 @@ Originally developed for PixiEditor: https://github.com/PixiEditor/PixiEditor.
-
-
+
+
@@ -44,12 +44,6 @@ Originally developed for PixiEditor: https://github.com/PixiEditor/PixiEditor.
-
-
- ColorPickerTheme.axaml
-
-
-
True
@@ -70,10 +64,4 @@ Originally developed for PixiEditor: https://github.com/PixiEditor/PixiEditor.
-
-
-
- ..\..\..\..\.nuget\packages\avalonia\11.0.5\ref\net6.0\Avalonia.Base.dll
-
-
diff --git a/src/ColorPicker.AvaloniaUI/Templates/GradientBar.axaml b/src/ColorPicker.AvaloniaUI/Templates/GradientBar.axaml
index a2faec3..e2186e8 100644
--- a/src/ColorPicker.AvaloniaUI/Templates/GradientBar.axaml
+++ b/src/ColorPicker.AvaloniaUI/Templates/GradientBar.axaml
@@ -2,7 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:colorPicker="clr-namespace:ColorPicker"
xmlns:converters="clr-namespace:ColorPicker.Converters"
- xmlns:system="clr-namespace:System;assembly=System.Runtime"
xmlns:models="clr-namespace:ColorPicker.Models;assembly=ColorPicker.Models">
@@ -49,7 +48,7 @@
-
+
diff --git a/src/ColorPicker.AvaloniaUI/Templates/HueSlider.axaml b/src/ColorPicker.AvaloniaUI/Templates/HueSlider.axaml
index 65dce29..42b6736 100644
--- a/src/ColorPicker.AvaloniaUI/Templates/HueSlider.axaml
+++ b/src/ColorPicker.AvaloniaUI/Templates/HueSlider.axaml
@@ -10,7 +10,7 @@
-
+
diff --git a/src/ColorPicker.AvaloniaUI/Templates/StandardColorPicker.axaml b/src/ColorPicker.AvaloniaUI/Templates/StandardColorPicker.axaml
index 71bf394..211eccf 100644
--- a/src/ColorPicker.AvaloniaUI/Templates/StandardColorPicker.axaml
+++ b/src/ColorPicker.AvaloniaUI/Templates/StandardColorPicker.axaml
@@ -89,7 +89,7 @@
-
@@ -120,7 +120,7 @@
StartPointY="{Binding NotifyableGradient.LinearStartPointY, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
EndPointX="{Binding NotifyableGradient.LinearEndPointX, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
EndPointY="{Binding NotifyableGradient.LinearEndPointY, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
- StartGradientStop="{Binding GradientBrush.GradientStops[0], RelativeSource={RelativeSource TemplatedParent}}"
+ StartGradientStop="{ReflectionBinding GradientBrush.GradientStops[0], RelativeSource={RelativeSource TemplatedParent}}"
EndGradientStop="{Binding GradientBrush.GradientStops, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource LastItemOfConverter}}" />
diff --git a/src/ColorPicker.Models/ColorPicker.Models.csproj b/src/ColorPicker.Models/ColorPicker.Models.csproj
index 5659ffa..d4fc6c1 100644
--- a/src/ColorPicker.Models/ColorPicker.Models.csproj
+++ b/src/ColorPicker.Models/ColorPicker.Models.csproj
@@ -1,7 +1,7 @@
- net8.0
+ net10.0
ColorPicker.Models
true
PixiEditor.ColorPicker.Models