File tree Expand file tree Collapse file tree 3 files changed +42
-5
lines changed Expand file tree Collapse file tree 3 files changed +42
-5
lines changed Original file line number Diff line number Diff line change
1
+ using System . Windows . Controls . Primitives ;
2
+ using System . Windows . Input ;
3
+
4
+ namespace MaterialDesignThemes . Wpf
5
+ {
6
+ internal class GridViewColumnThumb : Thumb
7
+ {
8
+ public GridViewColumnThumb ( ) : base ( ) { }
9
+
10
+ protected override void OnMouseLeftButtonDown ( MouseButtonEventArgs e )
11
+ {
12
+ Mouse . OverrideCursor = Cursors . SizeWE ;
13
+ base . OnMouseLeftButtonDown ( e ) ;
14
+ }
15
+
16
+ protected override void OnMouseLeftButtonUp ( MouseButtonEventArgs e )
17
+ {
18
+ base . OnMouseLeftButtonUp ( e ) ;
19
+ Mouse . OverrideCursor = null ;
20
+ }
21
+ }
22
+ }
Original file line number Diff line number Diff line change 88
88
<Setter .Value>
89
89
<ControlTemplate TargetType =" GridViewColumnHeader" >
90
90
<DockPanel >
91
- <Thumb x : Name =" PART_HeaderGripper"
92
- DockPanel.Dock=" Right"
93
- Margin =" 0,0,-8,0"
94
- Style =" {StaticResource MaterialDesignGridColumnHeaderGripper }" />
91
+ <wpf : GridViewColumnThumb x : Name =" PART_HeaderGripper"
92
+ DockPanel.Dock=" Right"
93
+ Margin =" 0,0,-8,0"
94
+ Style =" {StaticResource MaterialDesignGridViewColumnHeaderGripper }" />
95
95
<Border x : Name =" HeaderBorder"
96
96
Padding =" {TemplateBinding Padding}"
97
97
BorderThickness =" {TemplateBinding BorderThickness}" >
Original file line number Diff line number Diff line change 1
1
<ResourceDictionary xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2
2
xmlns : x =" http://schemas.microsoft.com/winfx/2006/xaml"
3
- xmlns : local =" clr-namespace:MaterialDesignTheme " >
3
+ xmlns : local =" clr-namespace:MaterialDesignThemes.Wpf " >
4
4
5
5
<Style x : Key =" MaterialDesignThumb" TargetType =" {x:Type Thumb}" >
6
6
<Setter Property =" SnapsToDevicePixels" Value =" True" />
29
29
<Setter Property =" Cursor" Value =" SizeWE" />
30
30
</Style >
31
31
32
+ <Style x : Key =" MaterialDesignGridViewColumnHeaderGripper" TargetType =" {x:Type Thumb}" BasedOn =" {StaticResource MaterialDesignThumb}" >
33
+ <Setter Property =" Width" Value =" 8" />
34
+ <Setter Property =" Template" >
35
+ <Setter .Value>
36
+ <ControlTemplate TargetType =" {x:Type Thumb}" >
37
+ <Border x : Name =" PART_Border"
38
+ Cursor =" SizeWE"
39
+ Padding =" {TemplateBinding Padding}"
40
+ Background =" {TemplateBinding Background}"
41
+ SnapsToDevicePixels =" {TemplateBinding SnapsToDevicePixels}" />
42
+ </ControlTemplate >
43
+ </Setter .Value>
44
+ </Setter >
45
+ </Style >
46
+
32
47
</ResourceDictionary >
You can’t perform that action at this time.
0 commit comments