Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/MaterialDesignThemes.Wpf/ListBoxItemAssist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
<Setter Property="wpf:ListBoxItemAssist.HoverBackground" Value="{Binding Foreground, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BrushOpacityConverter.Instance}, ConverterParameter=0.1}" />
<Setter Property="wpf:ListBoxItemAssist.SelectedFocusedBackground" Value="{Binding Foreground, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BrushOpacityConverter.Instance}, ConverterParameter=0.18}" />
<Setter Property="wpf:ListBoxItemAssist.SelectedUnfocusedBackground" Value="{Binding Foreground, RelativeSource={RelativeSource Self}, Converter={x:Static converters:BrushOpacityConverter.Instance}, ConverterParameter=0.09}" />
<Setter Property="Cursor" Value="{Binding Path=(wpf:ListBoxItemAssist.Cursor), RelativeSource={RelativeSource AncestorType=ListBox}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
Expand Down Expand Up @@ -423,6 +424,7 @@
<Setter Property="Margin" Value="4,2,4,2" />
<Setter Property="Padding" Value="8" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Cursor" Value="{Binding Path=(wpf:ListBoxItemAssist.Cursor), RelativeSource={RelativeSource AncestorType=ListBox}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
Expand Down
Loading