|
1 | 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
2 | 2 |
|
3 | | - <!-- |
4 | | - Preview adorner style – shown while dragging when ShowsPreview=True. |
5 | | - Resize only takes effect on mouse release. |
6 | | - --> |
7 | 3 | <Style x:Key="GridSplitterPreviewStyle"> |
8 | 4 | <Setter Property="Control.Template"> |
9 | 5 | <Setter.Value> |
|
17 | 13 | </Setter> |
18 | 14 | </Style> |
19 | 15 |
|
20 | | - <!-- |
21 | | - • ShowsPreview = True → resize commits only on mouse release |
22 | | - • MinWidth / MinHeight ensure the Auto-sized row/column is never 0-px |
23 | | - • Outer border is transparent with Padding=2 for a wider hit-test area |
24 | | - • Inner visual bar has no content children — avoids any layout-jump on hover |
25 | | - • Hover / Focus → bar turns accent colour |
26 | | - --> |
27 | 16 | <Style x:Key="DefaultGridSplitterStyle" TargetType="{x:Type GridSplitter}"> |
| 17 | + <Setter Property="OverridesDefaultStyle" Value="True" /> |
| 18 | + <Setter Property="IsTabStop" Value="True" /> |
28 | 19 | <Setter Property="ShowsPreview" Value="True" /> |
29 | 20 | <Setter Property="MinWidth" Value="6" /> |
30 | 21 | <Setter Property="MinHeight" Value="6" /> |
|
41 | 32 | <!-- Transparent outer region — widens the grab area beyond the visual bar --> |
42 | 33 | <Border |
43 | 34 | x:Name="Root" |
44 | | - Padding="2" |
| 35 | + Margin="1" |
| 36 | + Padding="1" |
45 | 37 | Background="Transparent" |
46 | 38 | SnapsToDevicePixels="True"> |
47 | | - <!-- Visual bar — no children so its size never jumps --> |
48 | 39 | <Border |
49 | 40 | x:Name="Bar" |
50 | 41 | Background="{DynamicResource ControlStrokeColorDefaultBrush}" |
|
68 | 59 |
|
69 | 60 | <Style BasedOn="{StaticResource DefaultGridSplitterStyle}" TargetType="GridSplitter" /> |
70 | 61 |
|
| 62 | + <Style |
| 63 | + x:Key="HiddenGridSplitterStyle" |
| 64 | + BasedOn="{StaticResource DefaultGridSplitterStyle}" |
| 65 | + TargetType="{x:Type GridSplitter}"> |
| 66 | + <Setter Property="MinWidth" Value="0" /> |
| 67 | + <Setter Property="MinHeight" Value="0" /> |
| 68 | + </Style> |
| 69 | + |
71 | 70 | </ResourceDictionary> |
0 commit comments