|
|
@@ -1,38 +1,155 @@
|
|
|
<UserControl xmlns="https://github.com/avaloniaui"
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
xmlns:conv="clr-namespace:Avalonia.Diagnostics.Converters"
|
|
|
+ xmlns:local="clr-namespace:Avalonia.Diagnostics.Views"
|
|
|
x:Class="Avalonia.Diagnostics.Views.ControlDetailsView">
|
|
|
- <Grid ColumnDefinitions="*,Auto" RowDefinitions="Auto,*">
|
|
|
-
|
|
|
- <TextBox Grid.Row="0" Grid.Column="0"
|
|
|
- BorderThickness="0"
|
|
|
- Text="{Binding TreePage.PropertyFilter}"
|
|
|
- Watermark="Filter properties" />
|
|
|
-
|
|
|
- <CheckBox Grid.Row="0"
|
|
|
- Grid.Column="1"
|
|
|
- Content="Regex"
|
|
|
- IsChecked="{Binding TreePage.UseRegexFilter}"/>
|
|
|
-
|
|
|
- <DataGrid Items="{Binding PropertiesView}"
|
|
|
- Grid.Row="1" Grid.ColumnSpan="2"
|
|
|
- BorderThickness="0"
|
|
|
- RowBackground="Transparent"
|
|
|
- SelectedItem="{Binding SelectedProperty, Mode=TwoWay}"
|
|
|
- CanUserResizeColumns="true">
|
|
|
- <DataGrid.Columns>
|
|
|
- <DataGridTextColumn Header="Property" Binding="{Binding Name}" IsReadOnly="True" />
|
|
|
- <DataGridTextColumn Header="Value" Binding="{Binding Value}" />
|
|
|
- <DataGridTextColumn Header="Type" Binding="{Binding Type}" />
|
|
|
- <DataGridTextColumn Header="Priority" Binding="{Binding Priority}" IsReadOnly="True" />
|
|
|
- </DataGrid.Columns>
|
|
|
-
|
|
|
- <DataGrid.Styles>
|
|
|
- <Style Selector="DataGridRow TextBox">
|
|
|
- <Setter Property="SelectionBrush" Value="LightBlue"/>
|
|
|
- </Style>
|
|
|
- </DataGrid.Styles>
|
|
|
- </DataGrid>
|
|
|
|
|
|
+ <UserControl.Resources>
|
|
|
+ <SolidColorBrush x:Key="ThicknessBorderBrush" Color="#666666" />
|
|
|
+ <SolidColorBrush x:Key="SizeGuidelineBrush" Color="#333333" />
|
|
|
+ <SolidColorBrush x:Key="MarginBackgroundBrush" Color="#D78965" />
|
|
|
+ <SolidColorBrush x:Key="BorderBackgroundBrush" Color="#E3C381" />
|
|
|
+ <SolidColorBrush x:Key="PaddingBackgroundBrush" Color="#B8C47F" />
|
|
|
+ <SolidColorBrush x:Key="SizeBackgroundBrush" Color="#88B2BD" />
|
|
|
+ </UserControl.Resources>
|
|
|
+
|
|
|
+ <UserControl.Styles>
|
|
|
+ <Style Selector="local|ThicknessEditor">
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
+ <Setter Property="BorderThickness" Value="1" />
|
|
|
+ <Setter Property="BorderBrush" Value="{StaticResource ThicknessBorderBrush}" />
|
|
|
+ <Setter Property="Template">
|
|
|
+ <ControlTemplate>
|
|
|
+ <Border
|
|
|
+ Background="{TemplateBinding Background}"
|
|
|
+ BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
+ BorderThickness="{TemplateBinding BorderThickness}">
|
|
|
+ <Grid RowDefinitions="Auto,*,Auto" ColumnDefinitions="Auto,*,Auto">
|
|
|
+ <Grid.Styles>
|
|
|
+ <Style Selector="TextBox.thickness-edit">
|
|
|
+ <Setter Property="Background" Value="Transparent" />
|
|
|
+ <Setter Property="BorderThickness" Value="0" />
|
|
|
+ <Setter Property="Margin" Value="2" />
|
|
|
+ <Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
|
+ <Setter Property="VerticalAlignment" Value="Stretch" />
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
|
+ <Setter Property="VerticalContentAlignment" Value="Center" />
|
|
|
+ <Setter Property="(ScrollViewer.HorizontalScrollBarVisibility)" Value="Disabled" />
|
|
|
+ <Setter Property="(ScrollViewer.VerticalScrollBarVisibility)" Value="Disabled" />
|
|
|
+ <Setter Property="IsVisible" Value="{Binding $parent[local:ThicknessEditor].IsPresent}" />
|
|
|
+ </Style>
|
|
|
+ </Grid.Styles>
|
|
|
+ <TextBlock IsVisible="{TemplateBinding IsPresent}" Margin="4,0,0,0" Text="{TemplateBinding Header}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" />
|
|
|
+ <TextBox Grid.Row="1" Grid.Column="0" Text="{Binding Left, RelativeSource={RelativeSource TemplatedParent}}" Classes="thickness-edit" />
|
|
|
+ <TextBox x:Name="Right" Grid.Row="0" Grid.Column="1" Text="{Binding Top, RelativeSource={RelativeSource TemplatedParent}}" Classes="thickness-edit" />
|
|
|
+ <TextBox Grid.Row="1" Grid.Column="2" Text="{Binding Right, RelativeSource={RelativeSource TemplatedParent}}" Classes="thickness-edit" />
|
|
|
+ <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Bottom, RelativeSource={RelativeSource TemplatedParent}}" Classes="thickness-edit" />
|
|
|
+ <ContentPresenter Grid.Row="1" Grid.Column="1"
|
|
|
+ Name="PART_ContentPresenter"
|
|
|
+ ContentTemplate="{TemplateBinding ContentTemplate}"
|
|
|
+ Content="{TemplateBinding Content}"
|
|
|
+ Padding="{TemplateBinding Padding}"
|
|
|
+ VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
|
+ HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
|
|
|
+ </Grid>
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter>
|
|
|
+ </Style>
|
|
|
+ <Style Selector="local|ThicknessEditor[IsPresent=False]">
|
|
|
+ <Setter Property="BorderThickness" Value="0" />
|
|
|
+ </Style>
|
|
|
+ </UserControl.Styles>
|
|
|
+
|
|
|
+ <Grid ColumnDefinitions="*,Auto,280">
|
|
|
+
|
|
|
+ <Grid Grid.Column="0" ColumnDefinitions="*,Auto,Auto,Auto" RowDefinitions="Auto,*">
|
|
|
+
|
|
|
+ <TextBox Grid.Row="0"
|
|
|
+ Grid.Column="0"
|
|
|
+ BorderThickness="0"
|
|
|
+ Text="{Binding TreePage.PropertyFilter}"
|
|
|
+ Watermark="Filter properties" />
|
|
|
+
|
|
|
+ <CheckBox Grid.Row="0"
|
|
|
+ Grid.Column="1"
|
|
|
+ Margin="0,0,4,0"
|
|
|
+ Content="Regex"
|
|
|
+ IsChecked="{Binding TreePage.UseRegexFilter}" />
|
|
|
+
|
|
|
+ <DataGrid Items="{Binding PropertiesView}"
|
|
|
+ Grid.Row="1"
|
|
|
+ Grid.Column="0"
|
|
|
+ Grid.ColumnSpan="2"
|
|
|
+ BorderThickness="0"
|
|
|
+ RowBackground="Transparent"
|
|
|
+ SelectedItem="{Binding SelectedProperty, Mode=TwoWay}"
|
|
|
+ CanUserResizeColumns="true">
|
|
|
+ <DataGrid.Columns>
|
|
|
+ <DataGridTextColumn Header="Property" Binding="{Binding Name}" IsReadOnly="True" />
|
|
|
+ <DataGridTextColumn Header="Value" Binding="{Binding Value}" />
|
|
|
+ <DataGridTextColumn Header="Type" Binding="{Binding Type}" />
|
|
|
+ <DataGridTextColumn Header="Priority" Binding="{Binding Priority}" IsReadOnly="True" />
|
|
|
+ </DataGrid.Columns>
|
|
|
+
|
|
|
+ <DataGrid.Styles>
|
|
|
+ <Style Selector="DataGridRow TextBox">
|
|
|
+ <Setter Property="SelectionBrush" Value="LightBlue" />
|
|
|
+ </Style>
|
|
|
+ </DataGrid.Styles>
|
|
|
+ </DataGrid>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <GridSplitter Grid.Column="1" />
|
|
|
+
|
|
|
+ <Grid Grid.Column="2" RowDefinitions="Auto,*" >
|
|
|
+ <TextBlock Grid.Row="0" Text="Layout Visualizer" Margin="4" />
|
|
|
+
|
|
|
+ <Grid Grid.Row="1" x:Name="LayoutRoot" Margin="8,0,8,8" RowDefinitions="Auto,Auto" ColumnDefinitions="Auto,Auto">
|
|
|
+
|
|
|
+ <Border x:Name="VerticalSize" Grid.Row="0" Grid.Column="1" >
|
|
|
+ <TextBlock VerticalAlignment="Center" FontWeight="Bold"
|
|
|
+ TextDecorations="{Binding Layout.HeightConstraint, Converter={x:Static local:Converters.HasConstraintConverter}}"
|
|
|
+ Text="{Binding Layout.Height}"
|
|
|
+ ToolTip.Tip="{Binding Layout.HeightConstraint}" />
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <Border x:Name="HorizontalSize" Grid.Row="1" Grid.Column="0" >
|
|
|
+ <TextBlock HorizontalAlignment="Center" FontWeight="Bold"
|
|
|
+ TextDecorations="{Binding Layout.WidthConstraint, Converter={x:Static local:Converters.HasConstraintConverter}}"
|
|
|
+ Text="{Binding Layout.Width}"
|
|
|
+ ToolTip.Tip="{Binding Layout.WidthConstraint}" />
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <local:ThicknessEditor Grid.Row="0" Grid.Column="0" Header="margin" VerticalAlignment="Top" HorizontalAlignment="Center" Background="{StaticResource MarginBackgroundBrush}" Thickness="{Binding Layout.MarginThickness}">
|
|
|
+ <local:ThicknessEditor x:Name="BorderArea" Header="border" Background="{StaticResource BorderBackgroundBrush}" Thickness="{Binding Layout.BorderThickness}" IsPresent="{Binding Layout.HasBorder}">
|
|
|
+ <local:ThicknessEditor x:Name="PaddingArea" Header="padding" Background="{StaticResource PaddingBackgroundBrush}" Thickness="{Binding Layout.PaddingThickness}" IsPresent="{Binding Layout.HasPadding}">
|
|
|
+ <Border x:Name="ContentArea" BorderThickness="1" BorderBrush="{StaticResource ThicknessBorderBrush}" MinWidth="100" MinHeight="16" Background="{StaticResource SizeBackgroundBrush}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
|
|
|
+ <TextBlock Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="content" />
|
|
|
+ </Border>
|
|
|
+ </local:ThicknessEditor>
|
|
|
+ </local:ThicknessEditor>
|
|
|
+ </local:ThicknessEditor>
|
|
|
+
|
|
|
+ <Canvas Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Grid.ColumnSpan="2">
|
|
|
+ <Canvas.Styles>
|
|
|
+ <Style Selector="Rectangle">
|
|
|
+ <Setter Property="StrokeDashArray" Value="1,3" />
|
|
|
+ <Setter Property="Stroke" Value="{StaticResource SizeGuidelineBrush}" />
|
|
|
+ <Setter Property="StrokeThickness" Value="1" />
|
|
|
+ </Style>
|
|
|
+ </Canvas.Styles>
|
|
|
+ <Rectangle x:Name="HorizontalSizeBegin" />
|
|
|
+ <Rectangle x:Name="HorizontalSizeEnd" />
|
|
|
+ <Rectangle x:Name="VerticalSizeBegin" />
|
|
|
+ <Rectangle x:Name="VerticalSizeEnd" />
|
|
|
+ </Canvas>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ </Grid>
|
|
|
</Grid>
|
|
|
+
|
|
|
</UserControl>
|