|
6 | 6 | xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
7 | 7 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
8 | 8 | xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
|
| 9 | + xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters;assembly=MaterialDesignThemes.Wpf" |
9 | 10 | d:DataContext="{d:DesignInstance domain:TreesViewModel}"
|
10 | 11 | d:DesignHeight="1080"
|
11 | 12 | d:DesignWidth="1920"
|
|
18 | 19 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.PopupBox.xaml" />
|
19 | 20 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.TextBlock.xaml" />
|
20 | 21 | </ResourceDictionary.MergedDictionaries>
|
| 22 | + |
| 23 | + <converters:TreeListViewIndentConverter x:Key="TreeListViewIndentConverter" /> |
21 | 24 | </ResourceDictionary>
|
22 | 25 | </UserControl.Resources>
|
23 | 26 |
|
|
216 | 219 | <materialDesign:TreeListView.Resources>
|
217 | 220 | <HierarchicalDataTemplate DataType="{x:Type domain:TestItem}"
|
218 | 221 | ItemsSource="{Binding Items, Mode=OneTime}">
|
219 |
| - <TextBlock Margin="3,2" Text="{Binding Name, Mode=OneTime}" /> |
| 222 | + <!--<TextBlock Margin="3,2" Text="{Binding Name, Mode=OneTime}" />--> |
220 | 223 | </HierarchicalDataTemplate>
|
221 | 224 |
|
222 | 225 | <HierarchicalDataTemplate DataType="{x:Type domain:MovieCategory}"
|
223 | 226 | ItemsSource="{Binding Movies, Mode=OneTime}">
|
224 |
| - <TextBlock Margin="3,2" Text="{Binding Name, Mode=OneTime}" /> |
| 227 | + <!--<TextBlock Margin="3,2" Text="{Binding Name, Mode=OneTime}" />--> |
225 | 228 | </HierarchicalDataTemplate>
|
226 | 229 |
|
227 | 230 | <DataTemplate DataType="{x:Type domain:Movie}">
|
228 |
| - <TextBlock Margin="3,2" |
| 231 | + <!--<TextBlock Margin="3,2" |
229 | 232 | Text="{Binding Name, Mode=OneTime}"
|
230 |
| - ToolTip="{Binding Director, Mode=OneTime}" /> |
| 233 | + ToolTip="{Binding Director, Mode=OneTime}" />--> |
231 | 234 | </DataTemplate>
|
232 | 235 | </materialDesign:TreeListView.Resources>
|
233 | 236 |
|
|
244 | 247 | <Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
|
245 | 248 | </Style>
|
246 | 249 | </materialDesign:TreeListView.ItemContainerStyle>
|
| 250 | + |
| 251 | + <materialDesign:TreeListView.Columns> |
| 252 | + <GridViewColumnCollection> |
| 253 | + <GridViewColumn Width="250" |
| 254 | + Header="Name"> |
| 255 | + <GridViewColumn.CellTemplate> |
| 256 | + <DataTemplate> |
| 257 | + <materialDesign:TreeListViewCell> |
| 258 | + <StackPanel Orientation="Horizontal"> |
| 259 | + <StackPanel.Margin> |
| 260 | + <MultiBinding Converter="{StaticResource TreeListViewIndentConverter}"> |
| 261 | + <Binding Path="LevelIndentSize" |
| 262 | + RelativeSource="{RelativeSource FindAncestor, AncestorType={x:Type materialDesign:TreeListView}}" /> |
| 263 | + <Binding Path="Level" |
| 264 | + RelativeSource="{RelativeSource AncestorType={x:Type materialDesign:TreeListViewItem}}" /> |
| 265 | + </MultiBinding> |
| 266 | + </StackPanel.Margin> |
| 267 | + |
| 268 | + <ToggleButton IsChecked="{Binding RelativeSource={RelativeSource AncestorType=materialDesign:TreeListViewItem, Mode=FindAncestor}, Path=IsExpanded}" |
| 269 | + Style="{StaticResource MaterialDesignTreeListViewToggleButtonStyle}" /> |
| 270 | + |
| 271 | + <TextBlock VerticalAlignment="Center" |
| 272 | + Text="{Binding Name, Mode=OneTime}" /> |
| 273 | + </StackPanel> |
| 274 | + </materialDesign:TreeListViewCell> |
| 275 | + </DataTemplate> |
| 276 | + </GridViewColumn.CellTemplate> |
| 277 | + </GridViewColumn> |
| 278 | + |
| 279 | + <GridViewColumn Width="100" |
| 280 | + Header="Count"> |
| 281 | + <GridViewColumn.CellTemplate> |
| 282 | + <DataTemplate> |
| 283 | + <materialDesign:TreeListViewCell> |
| 284 | + <TextBlock VerticalAlignment="Center" |
| 285 | + Text="{Binding Items.Count, Mode=OneWay}" /> |
| 286 | + </materialDesign:TreeListViewCell> |
| 287 | + </DataTemplate> |
| 288 | + </GridViewColumn.CellTemplate> |
| 289 | + </GridViewColumn> |
| 290 | + </GridViewColumnCollection> |
| 291 | + </materialDesign:TreeListView.Columns> |
247 | 292 | </materialDesign:TreeListView>
|
248 | 293 | <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right">
|
249 | 294 | <Button Command="{Binding AddListTreeItemCommand}"
|
|
0 commit comments