|
1 | 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 | 3 | xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters" |
4 | | - xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf" |
5 | | - xmlns:internal="clr-namespace:MaterialDesignThemes.Wpf.Internal"> |
| 4 | + xmlns:internal="clr-namespace:MaterialDesignThemes.Wpf.Internal" |
| 5 | + xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"> |
| 6 | + <converters:ViewIsGridViewConverter x:Key="ViewIsGridViewConverter" /> |
6 | 7 |
|
7 | 8 | <Style x:Key="MaterialDesignTreeListViewToggleButtonStyle" TargetType="{x:Type ToggleButton}"> |
8 | 9 | <Setter Property="Background" Value="Transparent" /> |
|
78 | 79 | </Canvas> |
79 | 80 | </Viewbox> |
80 | 81 | </Border> |
| 82 | + <ControlTemplate.Triggers> |
| 83 | + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpf:TreeListViewItem}}, Path=HasItems}" Value="false"> |
| 84 | + <Setter Property="Visibility" Value="Hidden" /> |
| 85 | + </DataTrigger> |
| 86 | + </ControlTemplate.Triggers> |
81 | 87 | </ControlTemplate> |
82 | 88 | </Setter.Value> |
83 | 89 | </Setter> |
|
105 | 111 | <Setter.Value> |
106 | 112 | <ControlTemplate TargetType="{x:Type wpf:TreeListViewItem}"> |
107 | 113 | <Grid> |
108 | | - <Grid.Margin> |
109 | | - <MultiBinding Converter="{x:Static converters:TreeListViewIndentConverter.Instance}"> |
110 | | - <Binding Path="LevelIndentSize" RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type wpf:TreeListView}}" FallbackValue="16" /> |
111 | | - <Binding Path="Level" RelativeSource="{RelativeSource TemplatedParent}" /> |
112 | | - </MultiBinding> |
113 | | - </Grid.Margin> |
114 | 114 | <Grid.ColumnDefinitions> |
115 | 115 | <ColumnDefinition Width="Auto" /> |
116 | 116 | <ColumnDefinition Width="Auto" /> |
|
164 | 164 | <VisualState x:Name="Collapsed" /> |
165 | 165 | </VisualStateGroup> |
166 | 166 | </VisualStateManager.VisualStateGroups> |
167 | | - <ToggleButton x:Name="Expander" |
168 | | - Width="{TemplateBinding wpf:TreeViewAssist.ExpanderSize}" |
169 | | - Height="{TemplateBinding wpf:TreeViewAssist.ExpanderSize}" |
170 | | - Margin="8,0,8,0" |
171 | | - VerticalAlignment="Center" |
172 | | - ClickMode="Press" |
173 | | - Foreground="{TemplateBinding Foreground}" |
174 | | - IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" |
175 | | - Style="{StaticResource MaterialDesignTreeListViewToggleButtonStyle}" /> |
176 | 167 |
|
177 | 168 | <Border x:Name="MouseOverBorder" |
178 | 169 | Grid.Column="1" |
|
198 | 189 | VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
199 | 190 | Feedback="{TemplateBinding Foreground, Converter={x:Static converters:BrushRoundConverter.Instance}}" |
200 | 191 | Focusable="False" |
| 192 | + Foreground="{TemplateBinding Foreground}" |
201 | 193 | SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"> |
202 | | - <internal:TreeListViewContentPresenter x:Name="PART_ContentPresenter" ContentSource="Content" /> |
| 194 | + <Grid Margin="0,0,0,0"> |
| 195 | + <internal:TreeListViewContentPresenter x:Name="PART_ContentPresenter" |
| 196 | + ContentSource="Content" |
| 197 | + Visibility="Visible" /> |
| 198 | + |
| 199 | + <GridViewRowPresenter x:Name="PART_GridViewRowPresenterr" |
| 200 | + Margin="{TemplateBinding Padding}" |
| 201 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| 202 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
| 203 | + Visibility="Collapsed" /> |
| 204 | + </Grid> |
203 | 205 | </wpf:Ripple> |
204 | 206 | </Grid> |
205 | 207 |
|
|
219 | 221 | <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:TreeViewAssist.AdditionalTemplateSelector), Converter={x:Static converters:NullableToVisibilityConverter.CollapsedInstance}, Mode=OneWay}" Value="Visible"> |
220 | 222 | <Setter TargetName="AdditionalContentControl" Property="Visibility" Value="Visible" /> |
221 | 223 | </DataTrigger> |
222 | | - <Trigger Property="HasItems" Value="false"> |
223 | | - <Setter TargetName="Expander" Property="Visibility" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:TreeViewAssist.HasNoItemsExpanderVisibility)}" /> |
224 | | - </Trigger> |
225 | 224 | <Trigger Property="IsEnabled" Value="false"> |
226 | 225 | <Setter Property="Opacity" Value=".56" /> |
227 | 226 | </Trigger> |
|
230 | 229 | <Setter TargetName="Ripple" Property="Feedback" Value="Transparent" /> |
231 | 230 | <Setter TargetName="SelectedBorder" Property="Visibility" Value="Collapsed" /> |
232 | 231 | </DataTrigger> |
| 232 | + <DataTrigger Binding="{Binding View, RelativeSource={RelativeSource Self}, Converter={StaticResource ViewIsGridViewConverter}}" Value="True"> |
| 233 | + <Setter TargetName="PART_ContentPresenter" Property="Visibility" Value="Hidden" /> |
| 234 | + <Setter TargetName="PART_GridViewRowPresenterr" Property="Visibility" Value="Visible" /> |
| 235 | + </DataTrigger> |
233 | 236 | </ControlTemplate.Triggers> |
234 | 237 | </ControlTemplate> |
235 | 238 | </Setter.Value> |
|
245 | 248 | <Setter Property="BorderBrush" Value="{x:Null}" /> |
246 | 249 | <Setter Property="BorderThickness" Value="0" /> |
247 | 250 | <Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" /> |
| 251 | + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
248 | 252 | <Setter Property="Padding" Value="1" /> |
249 | 253 | <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> |
250 | 254 | <Setter Property="ScrollViewer.PanningMode" Value="Both" /> |
|
257 | 261 | BorderThickness="{TemplateBinding BorderThickness}" |
258 | 262 | SnapsToDevicePixels="true"> |
259 | 263 | <ScrollViewer x:Name="PART_ScrollViewer" |
| 264 | + Style="{DynamicResource {x:Static GridView.GridViewScrollViewerStyleKey}}" |
260 | 265 | wpf:ScrollViewerAssist.IgnorePadding="{Binding Path=(wpf:ScrollViewerAssist.IgnorePadding), RelativeSource={RelativeSource TemplatedParent}}" |
261 | 266 | wpf:ScrollViewerAssist.PaddingMode="{Binding Path=(wpf:ScrollViewerAssist.PaddingMode), RelativeSource={RelativeSource TemplatedParent}}" |
262 | 267 | Padding="{TemplateBinding Padding}" |
|
0 commit comments