<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:views="clr-namespace:Avalonia.Diagnostics.Views"
             x:Class="Avalonia.Diagnostics.Views.MainView">
  <Grid Name="rootGrid" RowDefinitions="Auto,Auto,*,Auto,0,Auto">
    <Menu>
      <MenuItem Header="_File">
        <MenuItem Header="E_xit" Command="{Binding $parent[Window].Close}" />
        <MenuItem Header="Screenshot" Command="{Binding Shot}" HotKey="F8">
          <MenuItem.Icon>
            <Image>
              <DrawingImage>
                <DrawingGroup>
                  <GeometryDrawing Geometry="F1 M 13.4533,17.56C 13.4533,19.8827 15.344,21.772 17.6653,21.772L 17.6653,21.772C 19.988,21.772 21.8773,19.8827 21.8773,17.56L 21.8773,17.56C 21.8773,15.2373 19.988,13.348 17.6653,13.348L 17.6653,13.348C 15.344,13.348 13.4533,15.2373 13.4533,17.56 Z ">
                    <GeometryDrawing.Brush>
                      <RadialGradientBrush Center="0.245696,0.288009" GradientOrigin="0.245696,0.288009" Radius="0.499952">
                        <RadialGradientBrush.GradientStops>
                          <GradientStop Color="#FF878A8C" Offset="0" />
                          <GradientStop Color="#FF544A4C" Offset="0.991379" />
                        </RadialGradientBrush.GradientStops>
                      </RadialGradientBrush>
                    </GeometryDrawing.Brush>
                  </GeometryDrawing>
                  <GeometryDrawing Geometry="F1 M 13.332,6.22803L 10.2227,9.72668L 8.49866,9.72668L 8.49866,7.56136L 5.33333,7.56136L 5.33333,9.72668L 3.33333,9.72668L 3.33333,24.3947L 13.1213,24.3947C 14.424,25.264 15.9853,25.772 17.6653,25.772L 17.6653,25.772C 19.344,25.772 20.9067,25.264 22.2094,24.3947L 28.6667,24.3947L 28.6667,9.72668L 24.944,9.72668L 21.8333,6.22803M 12.12,17.56C 12.12,14.5013 14.608,12.0147 17.6653,12.0147L 17.6653,12.0147C 20.7227,12.0147 23.2107,14.5013 23.2107,17.56L 23.2107,17.56C 23.2107,20.6174 20.7227,23.104 17.6653,23.104L 17.6653,23.104C 14.608,23.104 12.12,20.6174 12.12,17.56 Z ">
                    <GeometryDrawing.Brush>
                      <RadialGradientBrush Center="0.196943,0.216757" GradientOrigin="0.196943,0.216757" Radius="0.44654">
                        <RadialGradientBrush.GradientStops>
                          <GradientStop Color="#FF87898C" Offset="0" />
                          <GradientStop Color="#FF544A4C" Offset="1" />
                        </RadialGradientBrush.GradientStops>
                      </RadialGradientBrush>
                    </GeometryDrawing.Brush>
                  </GeometryDrawing>
                </DrawingGroup>
              </DrawingImage>
            </Image>
          </MenuItem.Icon>
        </MenuItem>
      </MenuItem>
      <MenuItem Header="_View">
        <MenuItem Header="_Console" Command="{Binding $parent[UserControl].ToggleConsole}">
          <MenuItem.Icon>
            <CheckBox BorderThickness="0"
                      IsChecked="{Binding Console.IsVisible}"
                      IsEnabled="False" />
          </MenuItem.Icon>
        </MenuItem>
        <MenuItem Header="Control _Details">
          <MenuItem Header="Show Implemented Interfaces" Command="{Binding ToggleShowImplementedInterfaces}">
            <MenuItem.Icon>
              <CheckBox BorderThickness="0"
                        IsChecked="{Binding ShowImplementedInterfaces}"
                        IsEnabled="False" />
            </MenuItem.Icon>
          </MenuItem>
          <MenuItem Header="Split Property Type" Command="{Binding ToggleShowDettailsPropertyType}">
            <MenuItem.Icon>
              <CheckBox BorderThickness="0"
                        IsChecked="{Binding ShowDettailsPropertyType}"
                        IsEnabled="False"/>
            </MenuItem.Icon>

          </MenuItem>          
        </MenuItem>
      </MenuItem>
      <MenuItem Header="_Options">
        <MenuItem Header="Visualize margin/padding" Command="{Binding ToggleVisualizeMarginPadding}">
          <MenuItem.Icon>
            <CheckBox BorderThickness="0"
                      IsChecked="{Binding ShouldVisualizeMarginPadding}"
                      IsEnabled="False" />
          </MenuItem.Icon>
        </MenuItem>
        <MenuItem Header="Visualize dirty rects" Command="{Binding ToggleVisualizeDirtyRects}">
          <MenuItem.Icon>
            <CheckBox BorderThickness="0"
                      IsChecked="{Binding ShouldVisualizeDirtyRects}"
                      IsEnabled="False" />
          </MenuItem.Icon>
        </MenuItem>
        <MenuItem Header="Show fps overlay" Command="{Binding ToggleFpsOverlay}">
          <MenuItem.Icon>
            <CheckBox BorderThickness="0"
                      IsChecked="{Binding ShowFpsOverlay}"
                      IsEnabled="False" />
          </MenuItem.Icon>
        </MenuItem>
      </MenuItem>
    </Menu>

    <TabStrip Grid.Row="1" SelectedIndex="{Binding SelectedTab, Mode=TwoWay}">
      <TabStripItem Content="Logical Tree" />
      <TabStripItem Content="Visual Tree" />
      <TabStripItem Content="Events" />
    </TabStrip>

    <ContentControl Grid.Row="2"
                    BorderBrush="{DynamicResource ThemeControlMidBrush}"
                    BorderThickness="0,1,0,0"
                    Content="{Binding Content}" />

    <GridSplitter Name="consoleSplitter" Grid.Row="3" Height="1"
                  Background="{DynamicResource ThemeControlMidBrush}"
                  IsVisible="False" />

    <views:ConsoleView Name="console"
                       Grid.Row="4"
                       DataContext="{Binding Console}"
                       IsVisible="{Binding IsVisible}" />


    <Border Grid.Row="5"
            BorderBrush="{DynamicResource ThemeControlMidBrush}"
            BorderThickness="0,1,0,0">
      <Grid ColumnDefinitions="*, Auto">
        <StackPanel Grid.Column="0" Spacing="4" Orientation="Horizontal">
          <TextBlock>Hold Ctrl+Shift over a control to inspect.</TextBlock>
          <Separator Width="8" />
          <TextBlock>Focused:</TextBlock>
          <TextBlock Text="{Binding FocusedControl}" />
          <Separator Width="8" />
          <TextBlock>Pointer Over:</TextBlock>
          <TextBlock Text="{Binding PointerOverElementName}" />
        </StackPanel>

        <TextBlock Grid.Column="1"
                   Foreground="Gray"
                   Margin="2 0"
                   Text="Popups frozen"
                   IsVisible="{Binding FreezePopups}" />
      </Grid>

    </Border>
  </Grid>
</UserControl>
