|
@@ -1,6 +1,7 @@
|
|
|
using System;
|
|
|
using System.Collections.Concurrent;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Linq;
|
|
|
using Avalonia.Input;
|
|
|
|
|
|
namespace Xilium.CefGlue.Avalonia
|
|
@@ -17,7 +18,17 @@ namespace Xilium.CefGlue.Avalonia
|
|
|
foreach(StandardCursorType type in Enum.GetValues(typeof(StandardCursorType)))
|
|
|
{
|
|
|
var cursor = new Cursor(type);
|
|
|
- _cache[cursor.PlatformCursor.Handle] = cursor;
|
|
|
+ var platformImpl = cursor.PlatformImpl;
|
|
|
+ if (platformImpl != null)
|
|
|
+ {
|
|
|
+ var platformImplType = platformImpl.GetType();
|
|
|
+ var handleProperty = platformImplType.GetProperties().FirstOrDefault(x => x.Name == "Handle");
|
|
|
+ if (handleProperty != null)
|
|
|
+ {
|
|
|
+ var handle = (IntPtr)handleProperty.GetValue(platformImpl);
|
|
|
+ _cache[handle] = cursor;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|