|
7 | 7 | xmlns:behaviors="clr-namespace:OneWare.Essentials.Behaviors;assembly=OneWare.Essentials" |
8 | 8 | xmlns:behaviors1="clr-namespace:OneWare.ProjectExplorer.Behaviors" |
9 | 9 | xmlns:viewModels="clr-namespace:OneWare.LibraryExplorer.ViewModels" |
| 10 | + xmlns:views1="clr-namespace:OneWare.ProjectExplorer.Views;assembly=OneWare.ProjectExplorer" |
10 | 11 | mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="450" |
11 | 12 | x:Class="OneWare.LibraryExplorer.Views.LibraryExplorerView" |
12 | 13 | Background="{DynamicResource ThemeControlLowBrush}" |
|
17 | 18 | BorderThickness="0"> |
18 | 19 |
|
19 | 20 | <UserControl.Styles> |
20 | | - |
21 | 21 | <Style Selector="TextBox"> |
22 | 22 | <Setter Property="Padding" Value="0" /> |
23 | 23 | <Setter Property="Margin" Value="0" /> |
|
26 | 26 | <Setter Property="TextWrapping" Value="NoWrap" /> |
27 | 27 | </Style> |
28 | 28 |
|
| 29 | + <StyleInclude Source="avares://OneWare.ProjectExplorer/Views/ProjectExplorerTheme.axaml"></StyleInclude> |
29 | 30 | </UserControl.Styles> |
30 | 31 |
|
31 | 32 | <Grid> |
|
41 | 42 | SearchText="{Binding SearchString, Mode=TwoWay}" VerticalAlignment="Center" |
42 | 43 | VerticalContentAlignment="Center" x:Name="SearchBox" Height="24" /> |
43 | 44 | </Border> |
44 | | - <TreeView AutoScrollToSelectedItem="True" |
45 | | - ScrollViewer.HorizontalScrollBarVisibility="Disabled" SelectionMode="Multiple" |
46 | | - SelectedItems="{Binding SelectedItems, Mode=TwoWay}" Grid.Row="1" Name="ProjectTree" |
47 | | - ItemsSource="{Binding Projects}"> |
48 | | - <TreeView.ContextMenu> |
| 45 | + <TreeDataGrid Name="ProjectTree" Grid.Row="1" CanUserSortColumns="False" |
| 46 | + ShowColumnHeaders="False" ScrollViewer.HorizontalScrollBarVisibility="Disabled" |
| 47 | + CanUserResizeColumns="False" |
| 48 | + AutoDragDropRows="False" |
| 49 | + Source="{Binding Source}"> |
| 50 | + <TreeDataGrid.ContextMenu> |
49 | 51 | <ContextMenu Classes="BindMenu" x:Name="TreeViewContextMenu" |
50 | 52 | ItemsSource="{Binding TreeViewContextMenu}" /> |
51 | | - </TreeView.ContextMenu> |
52 | | - <TreeView.Styles> |
53 | | - <Style Selector="TreeViewItem" x:DataType="models:IProjectExplorerNode"> |
54 | | - <Setter Property="IsExpanded" Value="{Binding IsExpanded}" /> |
| 53 | + </TreeDataGrid.ContextMenu> |
| 54 | + <TreeDataGrid.Styles> |
| 55 | + <Style Selector="TreeDataGridRow" x:DataType="models:IProjectExplorerNode"> |
55 | 56 | <Setter Property="Background" Value="{Binding Background}" /> |
56 | 57 | </Style> |
57 | | - </TreeView.Styles> |
58 | | - <TreeView.DataTemplates> |
59 | | - <TreeDataTemplate DataType="models:IProjectExplorerNode" ItemsSource="{Binding Children}"> |
| 58 | + <Style Selector="TreeDataGridRow TextBox:disabled /template/ Border#border"> |
| 59 | + <Setter Property="Opacity" Value="1" /> |
| 60 | + </Style> |
| 61 | + <!-- Manual two-way binding to Property IsExpanded --> |
| 62 | + <!-- If IsExpanded is bound directly, an unhandled exception when measuring the UI will occur --> |
| 63 | + <!-- Furthermore, it doesn't work to use the Func<bool> isExpanded property in the HierarchicalDataSource --> |
| 64 | + <Style Selector="TreeDataGridExpanderCell" x:DataType="models:IProjectFolder"> |
| 65 | + <Setter Property="views1:TreeDataGridExtension.IsExpandedExtension" |
| 66 | + Value="{Binding IsExpanded, Mode=OneWay}" /> |
| 67 | + </Style> |
| 68 | + <Style Selector="TreeDataGridExpanderCell /template/ ToggleButton#ExpanderToggleButton" |
| 69 | + x:DataType="models:IProjectFolder"> |
| 70 | + <Setter Property="Command" Value="{Binding SetIsExpandedFromView}" /> |
| 71 | + </Style> |
| 72 | + </TreeDataGrid.Styles> |
| 73 | + <TreeDataGrid.Resources> |
| 74 | + <DataTemplate x:Key="ProjectExplorerColumnTemplate" DataType="models:IProjectExplorerNode"> |
60 | 75 | <DockPanel> |
61 | 76 | <StackPanel Orientation="Horizontal" DockPanel.Dock="Right"> |
62 | 77 | <ItemsControl ItemsSource="{Binding RightIcons}"> |
|
97 | 112 | </ItemsControl> |
98 | 113 | </Grid> |
99 | 114 |
|
100 | | - <!-- |
101 | | - <Grid DockPanel.Dock="Right" Width="11"> |
102 | | - <TextBlock HorizontalAlignment="Center" |
103 | | - ToolTip.Tip="{Binding GitChangeStatus, Converter={StaticResource EnumToStringConverter}}" |
104 | | - Text="{Binding GitChangeStatus, Converter={StaticResource ChangeStatusCharConverter}}" |
105 | | - FontWeight="Bold" |
106 | | - Foreground="{Binding GitChangeStatus, Converter={StaticResource ChangeStatusBrushConverter}}" /> |
107 | | - </Grid>--> |
108 | | - |
109 | 115 | <controls:RenamingTextBox FontWeight="{Binding FontWeight}" ToolTip.Tip="{Binding Header}" |
110 | 116 | VerticalAlignment="Center" |
111 | 117 | IsEnabled="False" x:Name="RenamingTextBox" |
|
114 | 120 | Opacity="{Binding TextOpacity}" /> |
115 | 121 | </StackPanel> |
116 | 122 | </DockPanel> |
117 | | - </TreeDataTemplate> |
118 | | - </TreeView.DataTemplates> |
119 | | - </TreeView> |
| 123 | + </DataTemplate> |
| 124 | + </TreeDataGrid.Resources> |
| 125 | + </TreeDataGrid> |
120 | 126 | </Grid> |
121 | 127 |
|
122 | 128 |
|
|
0 commit comments