Moved the left tree into its own view
This commit is contained in:
parent
a0d7806388
commit
42de9f73b0
@ -20,60 +20,7 @@
|
||||
<!-- Body: left tree | splitter | right details -->
|
||||
<Grid Grid.Row="1" ColumnDefinitions="2*,Auto,*" RowDefinitions="*">
|
||||
<!-- Left: Tree -->
|
||||
<Border Background="{DynamicResource PanelBackgroundBrush}"
|
||||
BorderBrush="{DynamicResource PanelBorderBrush}"
|
||||
BorderThickness="1" CornerRadius="6" Margin="0,8,8,0">
|
||||
<ScrollViewer>
|
||||
<TreeView x:Name="SchemaTree" ItemsSource="{Binding VisibleRootElements}">
|
||||
<TreeView.DataTemplates>
|
||||
<TreeDataTemplate DataType="{x:Type m:SchemaNode}" ItemsSource="{Binding Children}">
|
||||
<StackPanel>
|
||||
<!-- Connector line from parent to this node (hidden for roots where ContentModel is null) -->
|
||||
<Grid Margin="0,8,8,2" IsVisible="{Binding ContentModel, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
ColumnDefinitions="16,*">
|
||||
<!-- leading small elbow -->
|
||||
<Rectangle Grid.Column="0" Width="16" Height="2" Fill="{DynamicResource SeparatorBrush}" VerticalAlignment="Center"/>
|
||||
<Grid Grid.Column="1">
|
||||
<Rectangle Height="2" Fill="{DynamicResource SeparatorBrush}" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Cardinality, Converter={StaticResource CardinalityToLabel}}"
|
||||
Background="{DynamicResource BadgeBackgroundBrush}" Padding="6,0"
|
||||
Foreground="{DynamicResource SubtleTextBrush}"
|
||||
HorizontalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<!-- Node content -->
|
||||
<Border CornerRadius="4"
|
||||
BorderBrush="{Binding Cardinality, Converter={StaticResource OptionalToBrush}}"
|
||||
BorderThickness="{Binding Cardinality, Converter={StaticResource OptionalToThickness}}"
|
||||
Padding="8" Margin="0,0,8,6" Background="{DynamicResource PanelBackgroundBrush}">
|
||||
<StackPanel Orientation="Vertical" Spacing="2">
|
||||
<!-- Name on its own line, prominent -->
|
||||
<TextBlock Text="{Binding Name}" FontWeight="SemiBold"/>
|
||||
|
||||
<!-- Path/Namespace on its own line -->
|
||||
<TextBlock Text="{Binding Namespace, StringFormat=Namespace: {0}}"
|
||||
Foreground="{DynamicResource SubtleTextBrush}"/>
|
||||
|
||||
<!-- Type info on its own line (TypeName with fallback to BuiltInType) -->
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<TextBlock Text="Type:" FontWeight="Medium"/>
|
||||
<TextBlock Text="{Binding TypeName}"/>
|
||||
<TextBlock Text="{Binding BuiltInType, StringFormat=({0})}"
|
||||
Foreground="{DynamicResource MutedTextBrush}"/>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Optional: show content model as a subtle hint -->
|
||||
<TextBlock Text="{Binding ContentModel, StringFormat=Model: {0}}"
|
||||
Foreground="{DynamicResource SubtleTextBrush}" FontWeight="SemiBold"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</TreeDataTemplate>
|
||||
</TreeView.DataTemplates>
|
||||
</TreeView>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
<views:LeftTreeView Grid.Column="0" />
|
||||
|
||||
<!-- Splitter -->
|
||||
<GridSplitter Grid.Column="1" Width="6" Margin="4,8" Background="{DynamicResource PanelBorderBrush}" ShowsPreview="True"/>
|
||||
@ -83,7 +30,7 @@
|
||||
BorderBrush="{DynamicResource PanelBorderBrush}"
|
||||
BorderThickness="1" CornerRadius="6" Margin="8,8,0,0">
|
||||
<ScrollViewer>
|
||||
<ContentControl Content="{Binding #SchemaTree.SelectedItem}">
|
||||
<ContentControl Content="{Binding SelectedNode}">
|
||||
<ContentControl.DataTemplates>
|
||||
<DataTemplate DataType="{x:Type m:SchemaNode}">
|
||||
<StackPanel Margin="12" Spacing="12">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user