Moved out details view
This commit is contained in:
parent
42de9f73b0
commit
e442e1c89a
@ -1,148 +1,17 @@
|
|||||||
<Window xmlns="https://github.com/avaloniaui"
|
<Window xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:m="clr-namespace:XSDVisualiser.Models;assembly=XSDVisualiser.Core"
|
|
||||||
xmlns:conv="clr-namespace:XSDVisualiser.Desktop.Converters"
|
|
||||||
xmlns:views="clr-namespace:XSDVisualiser.Desktop.Views"
|
xmlns:views="clr-namespace:XSDVisualiser.Desktop.Views"
|
||||||
x:Class="XSDVisualiser.Desktop.MainWindow"
|
x:Class="XSDVisualiser.Desktop.MainWindow"
|
||||||
x:CompileBindings="False"
|
x:CompileBindings="False"
|
||||||
Title="XSD Visualiser" Width="1200" Height="800">
|
Title="XSD Visualiser" Width="1200" Height="800">
|
||||||
<Window.Resources>
|
|
||||||
<conv:CardinalityToLabelConverter x:Key="CardinalityToLabel"/>
|
|
||||||
<conv:OptionalToBorderBrushConverter x:Key="OptionalToBrush"/>
|
|
||||||
<conv:OptionalToThicknessConverter x:Key="OptionalToThickness"/>
|
|
||||||
<conv:CollectionHasItemsConverter x:Key="HasItems"/>
|
|
||||||
</Window.Resources>
|
|
||||||
|
|
||||||
<Grid RowDefinitions="Auto,*" Margin="12">
|
<Grid RowDefinitions="Auto,*" Margin="12">
|
||||||
<!-- Header -->
|
|
||||||
<views:HeaderView x:Name="Header" />
|
<views:HeaderView x:Name="Header" />
|
||||||
|
|
||||||
<!-- Body: left tree | splitter | right details -->
|
|
||||||
<Grid Grid.Row="1" ColumnDefinitions="2*,Auto,*" RowDefinitions="*">
|
<Grid Grid.Row="1" ColumnDefinitions="2*,Auto,*" RowDefinitions="*">
|
||||||
<!-- Left: Tree -->
|
|
||||||
<views:LeftTreeView Grid.Column="0" />
|
<views:LeftTreeView Grid.Column="0" />
|
||||||
|
|
||||||
<!-- Splitter -->
|
|
||||||
<GridSplitter Grid.Column="1" Width="6" Margin="4,8" Background="{DynamicResource PanelBorderBrush}" ShowsPreview="True"/>
|
<GridSplitter Grid.Column="1" Width="6" Margin="4,8" Background="{DynamicResource PanelBorderBrush}" ShowsPreview="True"/>
|
||||||
|
<views:RightDetailsView Grid.Column="2" />
|
||||||
<!-- Right: Details -->
|
|
||||||
<Border Grid.Column="2" 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>
|
|
||||||
|
|
||||||
<!-- 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="Enumerations" FontWeight="SemiBold"/>
|
|
||||||
<ItemsControl ItemsSource="{Binding Enumerations}" IsVisible="{Binding Enumerations, Converter={StaticResource HasItems}}">
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate x:DataType="x:String">
|
|
||||||
<TextBlock Text="{Binding ., StringFormat=• {0}}"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<StackPanel>
|
|
||||||
<TextBlock Text="Patterns" FontWeight="SemiBold"/>
|
|
||||||
<ItemsControl ItemsSource="{Binding Patterns}" IsVisible="{Binding Patterns, Converter={StaticResource HasItems}}">
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate x:DataType="x:String">
|
|
||||||
<TextBlock Text="{Binding ., StringFormat=• {0}}"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- Numeric bounds -->
|
|
||||||
<StackPanel IsVisible="{Binding Numeric, Converter={x:Static ObjectConverters.IsNotNull}}">
|
|
||||||
<TextBlock Text="Numeric bounds" FontWeight="SemiBold"/>
|
|
||||||
<StackPanel Orientation="Horizontal" IsVisible="{Binding Numeric.MinInclusive, Converter={x:Static ObjectConverters.IsNotNull}}">
|
|
||||||
<TextBlock Text="Min inclusive:" FontWeight="Bold"/>
|
|
||||||
<TextBlock Margin="8,0,0,0" Text="{Binding Numeric.MinInclusive}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" IsVisible="{Binding Numeric.MaxInclusive, Converter={x:Static ObjectConverters.IsNotNull}}">
|
|
||||||
<TextBlock Text="Max inclusive:" FontWeight="Bold"/>
|
|
||||||
<TextBlock Margin="8,0,0,0" Text="{Binding Numeric.MaxInclusive}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" IsVisible="{Binding Numeric.MinExclusive, Converter={x:Static ObjectConverters.IsNotNull}}">
|
|
||||||
<TextBlock Text="Min exclusive:" FontWeight="Bold"/>
|
|
||||||
<TextBlock Margin="8,0,0,0" Text="{Binding Numeric.MinExclusive}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" IsVisible="{Binding Numeric.MaxExclusive, Converter={x:Static ObjectConverters.IsNotNull}}">
|
|
||||||
<TextBlock Text="Max exclusive:" FontWeight="Bold"/>
|
|
||||||
<TextBlock Margin="8,0,0,0" Text="{Binding Numeric.MaxExclusive}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<!-- Length bounds -->
|
|
||||||
<StackPanel IsVisible="{Binding Length, Converter={x:Static ObjectConverters.IsNotNull}}">
|
|
||||||
<TextBlock Text="Length bounds" FontWeight="SemiBold"/>
|
|
||||||
<StackPanel Orientation="Horizontal" IsVisible="{Binding Length.LengthSpecified}">
|
|
||||||
<TextBlock Text="Length:" FontWeight="Bold"/>
|
|
||||||
<TextBlock Margin="8,0,0,0" Text="{Binding Length.Length}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" IsVisible="{Binding Length.MinLengthSpecified}">
|
|
||||||
<TextBlock Text="Min length:" FontWeight="Bold"/>
|
|
||||||
<TextBlock Margin="8,0,0,0" Text="{Binding Length.MinLength}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" IsVisible="{Binding Length.MaxLengthSpecified}">
|
|
||||||
<TextBlock Text="Max length:" FontWeight="Bold"/>
|
|
||||||
<TextBlock Margin="8,0,0,0" Text="{Binding Length.MaxLength}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
</ContentControl.DataTemplates>
|
|
||||||
</ContentControl>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
</DataTemplate>
|
|
||||||
</ContentControl.DataTemplates>
|
|
||||||
</ContentControl>
|
|
||||||
</ScrollViewer>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
122
XSDVisualiser.Desktop/Views/RightDetailsView.axaml
Normal file
122
XSDVisualiser.Desktop/Views/RightDetailsView.axaml
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
<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>
|
||||||
|
|
||||||
|
<!-- 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="Enumerations" FontWeight="SemiBold"/>
|
||||||
|
<ItemsControl ItemsSource="{Binding Enumerations}" IsVisible="{Binding Enumerations, Converter={StaticResource HasItems}}">
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="x:String">
|
||||||
|
<TextBlock Text="{Binding ., StringFormat=• {0}}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="Patterns" FontWeight="SemiBold"/>
|
||||||
|
<ItemsControl ItemsSource="{Binding Patterns}" IsVisible="{Binding Patterns, Converter={StaticResource HasItems}}">
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="x:String">
|
||||||
|
<TextBlock Text="{Binding ., StringFormat=• {0}}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Numeric bounds -->
|
||||||
|
<StackPanel IsVisible="{Binding Numeric, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||||
|
<TextBlock Text="Numeric bounds" FontWeight="SemiBold"/>
|
||||||
|
<StackPanel Orientation="Horizontal" IsVisible="{Binding Numeric.MinInclusive, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||||
|
<TextBlock Text="Min inclusive:" FontWeight="Bold"/>
|
||||||
|
<TextBlock Margin="8,0,0,0" Text="{Binding Numeric.MinInclusive}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" IsVisible="{Binding Numeric.MaxInclusive, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||||
|
<TextBlock Text="Max inclusive:" FontWeight="Bold"/>
|
||||||
|
<TextBlock Margin="8,0,0,0" Text="{Binding Numeric.MaxInclusive}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" IsVisible="{Binding Numeric.MinExclusive, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||||
|
<TextBlock Text="Min exclusive:" FontWeight="Bold"/>
|
||||||
|
<TextBlock Margin="8,0,0,0" Text="{Binding Numeric.MinExclusive}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" IsVisible="{Binding Numeric.MaxExclusive, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||||
|
<TextBlock Text="Max exclusive:" FontWeight="Bold"/>
|
||||||
|
<TextBlock Margin="8,0,0,0" Text="{Binding Numeric.MaxExclusive}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Length bounds -->
|
||||||
|
<StackPanel IsVisible="{Binding Length, Converter={x:Static ObjectConverters.IsNotNull}}">
|
||||||
|
<TextBlock Text="Length bounds" FontWeight="SemiBold"/>
|
||||||
|
<StackPanel Orientation="Horizontal" IsVisible="{Binding Length.LengthSpecified}">
|
||||||
|
<TextBlock Text="Length:" FontWeight="Bold"/>
|
||||||
|
<TextBlock Margin="8,0,0,0" Text="{Binding Length.Length}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" IsVisible="{Binding Length.MinLengthSpecified}">
|
||||||
|
<TextBlock Text="Min length:" FontWeight="Bold"/>
|
||||||
|
<TextBlock Margin="8,0,0,0" Text="{Binding Length.MinLength}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Orientation="Horizontal" IsVisible="{Binding Length.MaxLengthSpecified}">
|
||||||
|
<TextBlock Text="Max length:" FontWeight="Bold"/>
|
||||||
|
<TextBlock Margin="8,0,0,0" Text="{Binding Length.MaxLength}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ContentControl.DataTemplates>
|
||||||
|
</ContentControl>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ContentControl.DataTemplates>
|
||||||
|
</ContentControl>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
</UserControl>
|
||||||
12
XSDVisualiser.Desktop/Views/RightDetailsView.axaml.cs
Normal file
12
XSDVisualiser.Desktop/Views/RightDetailsView.axaml.cs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
|
namespace XSDVisualiser.Desktop.Views
|
||||||
|
{
|
||||||
|
public partial class RightDetailsView : UserControl
|
||||||
|
{
|
||||||
|
public RightDetailsView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user