87 lines
4.7 KiB
XML
87 lines
4.7 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:m="clr-namespace:XSDVisualiser.Models;assembly=XSDVisualiser.Core"
|
|
x:Class="XSDVisualiser.Desktop.Views.RightDetailsView"
|
|
x:CompileBindings="False">
|
|
<Border Background="{DynamicResource PanelBackgroundBrush}"
|
|
BorderBrush="{DynamicResource PanelBorderBrush}"
|
|
BorderThickness="1" CornerRadius="6" Margin="8,8,0,0">
|
|
<ScrollViewer>
|
|
<ContentControl Content="{Binding SelectedNode}">
|
|
<ContentControl.DataTemplates>
|
|
<DataTemplate DataType="{x:Type m:SchemaNode}">
|
|
<StackPanel Margin="12" Spacing="12">
|
|
<TextBlock Text="Details" FontSize="16" FontWeight="SemiBold"/>
|
|
|
|
<!-- General info -->
|
|
<Border BorderBrush="{DynamicResource PanelBorderBrush}" BorderThickness="1" CornerRadius="4" Padding="10">
|
|
<Grid ColumnDefinitions="Auto,*" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,*">
|
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="Name:" FontWeight="Bold"/>
|
|
<TextBlock Grid.Row="0" Grid.Column="1" Margin="8,0,0,0" Text="{Binding Name}"/>
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="Built-in:" FontWeight="Bold"/>
|
|
<TextBlock Grid.Row="1" Grid.Column="1" Margin="8,0,0,0" Text="{Binding BuiltInType}" FontWeight="Bold"/>
|
|
|
|
<TextBlock Grid.Row="2" Grid.Column="0" Text="Model:" FontWeight="Bold"/>
|
|
<TextBlock Grid.Row="2" Grid.Column="1" Margin="8,0,0,0" Text="{Binding ContentModel}"/>
|
|
|
|
<TextBlock Grid.Row="3" Grid.Column="0" Text="Namespace:" FontWeight="Bold"/>
|
|
<TextBlock Grid.Row="3" Grid.Column="1" Margin="8,0,0,0" Text="{Binding Namespace}"/>
|
|
|
|
<TextBlock Grid.Row="4" Grid.Column="0" Text="Cardinality:" FontWeight="Bold"/>
|
|
<TextBlock Grid.Row="4" Grid.Column="1" Margin="8,0,0,0" Text="{Binding Cardinality, Converter={StaticResource CardinalityToLabel}}"/>
|
|
|
|
<TextBlock Grid.Row="5" Grid.Column="0" Text="Nillable:" FontWeight="Bold"/>
|
|
<TextBlock Grid.Row="5" Grid.Column="1" Margin="8,0,0,0" Text="{Binding IsNillable}"/>
|
|
|
|
<TextBlock Grid.Row="6" Grid.Column="0" Text="Type:" FontWeight="Bold"/>
|
|
<TextBlock Grid.Row="6" Grid.Column="1" Margin="8,0,0,0" Text="{Binding TypeName}"/>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- Documentation -->
|
|
<StackPanel IsVisible="{Binding Documentation, Converter={x:Static ObjectConverters.IsNotNull}}">
|
|
<TextBlock Text="Documentation" FontWeight="SemiBold"/>
|
|
<Border BorderBrush="{DynamicResource PanelBorderBrush}" BorderThickness="1" CornerRadius="4" Padding="10">
|
|
<TextBlock Text="{Binding Documentation}" TextWrapping="Wrap"/>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
<!-- Constraints -->
|
|
<StackPanel>
|
|
<TextBlock Text="Constraints" FontWeight="SemiBold"/>
|
|
<ContentControl Content="{Binding Constraints}">
|
|
<ContentControl.DataTemplates>
|
|
<DataTemplate x:DataType="m:ConstraintSet">
|
|
<StackPanel Spacing="8">
|
|
<TextBlock Text="Base Type:" FontWeight="Bold"/>
|
|
<TextBlock Text="{Binding BaseTypeName}"/>
|
|
|
|
<StackPanel>
|
|
<TextBlock Text="Constraints" FontWeight="SemiBold"/>
|
|
<ItemsControl ItemsSource="{Binding Constraints}" IsVisible="{Binding Constraints, Converter={StaticResource HasItems}}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate x:DataType="m:ConstraintEntry">
|
|
<TextBlock>
|
|
<Run Text="• "/>
|
|
<Run Text="{Binding Name}"/>
|
|
<Run Text=": "/>
|
|
<Run Text="{Binding Value}"/>
|
|
</TextBlock>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ContentControl.DataTemplates>
|
|
</ContentControl>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ContentControl.DataTemplates>
|
|
</ContentControl>
|
|
</ScrollViewer>
|
|
</Border>
|
|
</UserControl>
|