From ef41cf268038bed8ae64ab18c238b012808c2fa4 Mon Sep 17 00:00:00 2001 From: Corvin Date: Wed, 14 May 2025 18:04:18 +0200 Subject: [PATCH] added AP to control the cursor when hovering over a ListBoxItem and made the default cursor the Hand --- 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 @@ +