<Page
    x:Class="Ghost.Editor.Views.Pages.EditPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:Ghost.Editor.Views.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:ghost="using:Ghost.Editor.Core.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Background="{ThemeResource LayerFillColorDefaultBrush}"
    NavigationCacheMode="Enabled"
    mc:Ignorable="d">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!--  Toolbar  -->
        <Grid
            Grid.Row="0"
            Padding="8,0"
            Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
            BorderBrush="{ThemeResource ControlElevationBorderBrush}"
            BorderThickness="0,0,0,1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <StackPanel
                Grid.Column="0"
                VerticalAlignment="Center"
                Orientation="Horizontal">
                <ComboBox
                    Width="200"
                    VerticalAlignment="Center"
                    SelectedIndex="0">
                    <StackPanel Orientation="Horizontal" Spacing="4">
                        <FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xE71D;" />
                        <TextBlock Text="Hierarchy Mode" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Spacing="4">
                        <FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xEC26;" />
                        <TextBlock Text="Scatter Mode" />
                    </StackPanel>
                </ComboBox>

                <Border Height="12" Style="{StaticResource VerticalDivider}" />

                <!--<MenuBar x:Name="TopMenuBar">
                    <MenuBarItem Title="File">
                        <MenuFlyoutItem Text="New" />
                        <MenuFlyoutItem Text="Open..." />
                        <MenuFlyoutItem Text="Save" />
                        <MenuFlyoutItem Text="Exit" />
                    </MenuBarItem>

                    <MenuBarItem Title="Edit">
                        <MenuFlyoutItem Text="Undo" />
                        <MenuFlyoutItem Text="Redo" />
                        <MenuFlyoutItem Text="Cut" />
                        <MenuFlyoutItem Text="Copy" />
                        <MenuFlyoutItem Text="Paste" />
                    </MenuBarItem>

                    <MenuBarItem Title="Help">
                        <MenuFlyoutItem Text="About" />
                    </MenuBarItem>
                </MenuBar>-->
                <ghost:MenuContextBar ContextMenuTag="edit-page-menu" />
            </StackPanel>

            <StackPanel
                Grid.Column="0"
                Grid.ColumnSpan="2"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Orientation="Horizontal"
                Spacing="4">
                <Button Style="{ThemeResource AccentToolbarButton}">
                    <FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xF5B0;" />
                </Button>
                <Button Style="{ThemeResource AccentToolbarButton}">
                    <FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xF8AE;" />
                </Button>
                <Button IsEnabled="False" Style="{ThemeResource AccentToolbarButton}">
                    <FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xEE95;" />
                </Button>
            </StackPanel>
        </Grid>

        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.25*" MaxWidth="350" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="0.25*" MaxWidth="350" />
            </Grid.ColumnDefinitions>

            <Border
                Grid.Column="0"
                BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
                BorderThickness="0,0,1,0">
                <controls:Hierarchy />
            </Border>

            <!--  Scene and Content  -->
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="0.3*" MaxHeight="350" />
                </Grid.RowDefinitions>

                <!--  Scene Toolbar  -->
                <StackPanel
                    Padding="2"
                    Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
                    BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
                    BorderThickness="0,0,0,1"
                    Orientation="Horizontal">
                    <Button Style="{ThemeResource ToolbarButton}">
                        <FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xE7C2;" />
                    </Button>
                    <Button Style="{ThemeResource ToolbarButton}">
                        <FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xE7AD;" />
                    </Button>
                    <Button Style="{ThemeResource ToolbarButton}">
                        <FontIcon FontSize="{StaticResource ToolbarFontIconFontSize}" Glyph="&#xE740;" />
                    </Button>
                </StackPanel>

                <!--  Scene  -->
                <Border
                    Grid.Row="1"
                    BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
                    BorderThickness="0,0,0,1">
                    <Image
                        VerticalAlignment="Center"
                        Source="C:/Users/Misaki/OneDrive/Pictures/Screenshots/Screenshot 2023-11-28 000914.png"
                        Stretch="UniformToFill" />
                </Border>

                <!--  Content Brower  -->
                <Border
                    Grid.Row="2"
                    Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
                    BorderBrush="{ThemeResource CircleElevationBorderBrush}"
                    BorderThickness="0,0,0,1">
                    <SelectorBar SelectionChanged="SelectorBar_SelectionChanged">
                        <SelectorBarItem IsSelected="True" Text="Project" />
                        <SelectorBarItem Text="Console" />
                        <SelectorBarItem Text="Log" />
                    </SelectorBar>
                </Border>

                <ContentPresenter x:Name="ContentBrowserPresenter" Grid.Row="3" />
            </Grid>

            <!--  Inspector  -->
            <Border
                Grid.Column="2"
                BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
                BorderThickness="1,0,0,0">
                <controls:Inspector />
            </Border>
        </Grid>
    </Grid>
</Page>
