From 35167dfbed5a541ed70369fdb916b03084819345 Mon Sep 17 00:00:00 2001
From: Corvin <43533385+corvinsz@users.noreply.github.com>
Date: Fri, 16 May 2025 06:18:21 +0200
Subject: [PATCH] added AP to control the cursor when hovering over a
ListBoxItem and made the default cursor the Hand (#3848)
---
src/MaterialDesignThemes.Wpf/ListBoxItemAssist.cs | 11 +++++++++++
.../Themes/MaterialDesignTheme.ListBox.xaml | 2 ++
2 files changed, 13 insertions(+)
diff --git a/src/MaterialDesignThemes.Wpf/ListBoxItemAssist.cs b/src/MaterialDesignThemes.Wpf/ListBoxItemAssist.cs
index d0675f472b..92350fd15b 100644
--- a/src/MaterialDesignThemes.Wpf/ListBoxItemAssist.cs
+++ b/src/MaterialDesignThemes.Wpf/ListBoxItemAssist.cs
@@ -61,4 +61,15 @@ public static void SetShowSelection(DependencyObject element, bool value)
public static readonly DependencyProperty ShowSelectionProperty =
DependencyProperty.RegisterAttached("ShowSelection", typeof(bool), typeof(ListBoxItemAssist), new PropertyMetadata(true));
#endregion
+
+ #region Cursor
+ public static Cursor GetCursor(DependencyObject obj)
+ => (Cursor)obj.GetValue(CursorProperty);
+
+ public static void SetCursor(DependencyObject obj, Cursor value)
+ => obj.SetValue(CursorProperty, value);
+
+ public static readonly DependencyProperty CursorProperty =
+ DependencyProperty.RegisterAttached("Cursor", typeof(Cursor), typeof(ListBoxItemAssist), new PropertyMetadata(Cursors.Hand));
+ #endregion
}
diff --git a/src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml b/src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml
index b013638621..3ba7c285e3 100644
--- a/src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml
+++ b/src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml
@@ -241,6 +241,7 @@
+
@@ -423,6 +424,7 @@
+