Skip to content

Commit b621a52

Browse files
committed
replace scrollviewers to restore mouse actions. fixes #334
1 parent cdf769f commit b621a52

File tree

2 files changed

+23
-25
lines changed

2 files changed

+23
-25
lines changed

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Expander.xaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
</ObjectAnimationUsingKeyFrames>
125125
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content"
126126
To="1" Duration="0:0:0.3"/>
127-
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer"
127+
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ContentPanel"
128128
To="1" Duration="0:0:0.3"/>
129129
</Storyboard>
130130
</VisualTransition>
@@ -138,15 +138,15 @@
138138
</ObjectAnimationUsingKeyFrames>
139139
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content"
140140
To="0" Duration="0:0:0.3"/>
141-
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer"
141+
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ContentPanel"
142142
To="0" Duration="0:0:0.3"/>
143143
</Storyboard>
144144
</VisualTransition>
145145
</VisualStateGroup.Transitions>
146146
<VisualState x:Name="Expanded">
147147
<Storyboard>
148148
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0"/>
149-
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer" To="1" Duration="0"/>
149+
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ContentPanel" To="1" Duration="0"/>
150150
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
151151
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
152152
</ObjectAnimationUsingKeyFrames>
@@ -155,7 +155,7 @@
155155
<VisualState x:Name="Collapsed">
156156
<Storyboard>
157157
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0"/>
158-
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer" To="0" Duration="0"/>
158+
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ContentPanel" To="0" Duration="0"/>
159159
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility">
160160
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
161161
</ObjectAnimationUsingKeyFrames>
@@ -184,19 +184,18 @@
184184
</Grid>
185185
</Border>
186186
<Border Grid.Row="1">
187-
<ScrollViewer x:Name="ItemsScrollViewer"
188-
VerticalScrollBarVisibility="Hidden">
189-
<ScrollViewer.Tag>
187+
<StackPanel x:Name="ContentPanel">
188+
<StackPanel.Tag>
190189
<system:Double>0.0</system:Double>
191-
</ScrollViewer.Tag>
192-
<ScrollViewer.Height>
190+
</StackPanel.Tag>
191+
<StackPanel.Height>
193192
<MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
194193
<Binding ElementName="PART_Content" Path="ActualHeight"/>
195194
<Binding RelativeSource="{RelativeSource Self}" Path="Tag"/>
196195
</MultiBinding>
197-
</ScrollViewer.Height>
196+
</StackPanel.Height>
198197
<ContentPresenter Name="PART_Content" />
199-
</ScrollViewer>
198+
</StackPanel>
200199
</Border>
201200
</Grid>
202201
</ControlTemplate>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TreeView.xaml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@
216216
</ObjectAnimationUsingKeyFrames>
217217
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ItemsHost"
218218
To="1" Duration="0:0:0.3"/>
219-
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer"
219+
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsPanel"
220220
To="1" Duration="0:0:0.3"/>
221221
</Storyboard>
222222
</VisualTransition>
@@ -230,7 +230,7 @@
230230
</ObjectAnimationUsingKeyFrames>
231231
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ItemsHost"
232232
To="0" Duration="0:0:0.3"/>
233-
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer"
233+
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsPanel"
234234
To="0" Duration="0:0:0.3"/>
235235
</Storyboard>
236236
</VisualTransition>
@@ -239,7 +239,7 @@
239239
<Storyboard>
240240
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ItemsHost"
241241
To="1" Duration="0"/>
242-
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer"
242+
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsPanel"
243243
To="1" Duration="0"/>
244244
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="Visibility">
245245
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
@@ -250,7 +250,7 @@
250250
<Storyboard>
251251
<DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ItemsHost"
252252
To="0" Duration="0"/>
253-
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer"
253+
<DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsPanel"
254254
To="0" Duration="0"/>
255255
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="Visibility">
256256
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
@@ -290,25 +290,24 @@
290290
</wpf:Ripple>
291291
</Grid>
292292

293-
<ScrollViewer Grid.Column="1" Grid.Row="1"
294-
x:Name="ItemsScrollViewer"
295-
Margin="-16 0 0 0"
296-
VerticalScrollBarVisibility="Hidden"
297-
Grid.ColumnSpan="2">
298-
<ScrollViewer.Tag>
293+
<StackPanel Grid.Column="1" Grid.Row="1"
294+
x:Name="ItemsPanel"
295+
Margin="-16 0 0 0"
296+
Grid.ColumnSpan="2">
297+
<StackPanel.Tag>
299298
<system:Double>0.0</system:Double>
300-
</ScrollViewer.Tag>
301-
<ScrollViewer.Height>
299+
</StackPanel.Tag>
300+
<StackPanel.Height>
302301
<MultiBinding Converter="{StaticResource MathMlpMultipleConverter}">
303302
<Binding ElementName="ItemsHost" Path="ActualHeight"/>
304303
<Binding RelativeSource="{RelativeSource Self}" Path="Tag"/>
305304
</MultiBinding>
306-
</ScrollViewer.Height>
305+
</StackPanel.Height>
307306
<ItemsPresenter x:Name="ItemsHost"
308307
VerticalAlignment="Top"
309308
Opacity="0"
310309
Visibility="Collapsed"/>
311-
</ScrollViewer>
310+
</StackPanel>
312311
</Grid>
313312
<ControlTemplate.Triggers>
314313
<Trigger Property="HasItems" Value="false">

0 commit comments

Comments
 (0)