Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Thumb Control and ControlTemplate to fix issue #1531 #1542

Merged
merged 2 commits into from Dec 5, 2019

Conversation

@Jesus805
Copy link
Contributor

Jesus805 commented Dec 2, 2019

Hi,
I created a ControlTemplate (in MaterialDesignGridColumnHeaderGripper) that sets the cursor to SizeWE. This is necessary because the Cursor needs to be explicitly set in ControlTemplate or else the cursor is set to "None" or in some cases disappears in the GridViewColumnHeader.
I also created a Thumb Control to override the cursor when dragging. This is necessary because when dragging, the cursor will revert to "None".

With these changes, a GridView be consistent with the DataGrid control.

…ntrolTemplate for Thumb that sets cursor to SizeWE
@Keboo Keboo self-requested a review Dec 2, 2019
MaterialDesignThemes.Wpf/GridViewColumnThumb.cs Outdated Show resolved Hide resolved
@@ -88,7 +88,7 @@
<Setter.Value>
<ControlTemplate TargetType="GridViewColumnHeader">
<DockPanel>
<Thumb x:Name="PART_HeaderGripper"
<wpf:GridViewColumnThumb x:Name="PART_HeaderGripper"

This comment has been minimized.

Copy link
@Keboo

Keboo Dec 5, 2019

Member

Rather than changing the MaterialDesignGridColumnHeaderGripper template, lets simply do an explicit style on this element and base it on MaterialDesignGridColumnHeaderGripper and set the template here. This way we won't accidently change any other thumbs that may not be expecting this behavior.

This comment has been minimized.

Copy link
@Jesus805

Jesus805 Dec 5, 2019

Author Contributor

I created a new style named MaterialDesignGridViewColumnHeaderGripper. The GridView Gripper does not use <Setter Property="Cursor" Value="SizeWE"/> so I opted to set the base as MaterialDesignThumb

GridViewColumnThumb is now internal.
Created a new style explicitly for the GridView Column.
GridViewColumnHeader now uses this new style.
@Keboo
Keboo approved these changes Dec 5, 2019
Copy link
Member

Keboo left a comment

Awesome thanks

@Keboo Keboo added this to the 3.0.0 milestone Dec 5, 2019
@Keboo Keboo merged commit c1c328b into MaterialDesignInXAML:master Dec 5, 2019
1 check passed
1 check passed
MaterialDesignInXAML.MaterialDesignInXamlToolkit #20191205.1 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.