<UserControl
    x:Class="Pixeval.Controls.WorkViewerSplitView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:Pixeval.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:windowing="using:Pixeval.Controls.Windowing"
    mc:Ignorable="d">
    <SplitView
        x:Name="SplitView"
        DisplayMode="Inline"
        IsPaneOpen="{x:Bind IsPaneOpen, Mode=TwoWay}"
        OpenPaneLength="{x:Bind local:WorkViewerSplitView.OpenPaneLength}"
        PaneBackground="Transparent">
        <SplitView.Pane>
            <Grid
                BorderBrush="{ThemeResource ApplicationPageBackgroundThemeBrush}"
                CornerRadius="4"
                Translation="0,0,40">
                <NavigationView
                    x:Name="NavigationView"
                    IsBackButtonVisible="Collapsed"
                    IsSettingsVisible="False"
                    MenuItemsSource="{x:Bind MenuItemsSource}"
                    PaneDisplayMode="Top"
                    SelectedItem="{x:Bind local:C.FirstOrDefault(MenuItemsSource)}"
                    SelectionChanged="NavigationViewOnSelectionChanged">
                    <NavigationView.MenuItemTemplate>
                        <DataTemplate x:DataType="windowing:NavigationViewTag">
                            <NavigationViewItem
                                Content="{x:Bind}"
                                Icon="{x:Bind Icon}"
                                Tag="{x:Bind}" />
                        </DataTemplate>
                    </NavigationView.MenuItemTemplate>
                    <Frame x:Name="PaneFrame" x:FieldModifier="public" />
                </NavigationView>
            </Grid>
        </SplitView.Pane>
        <ContentPresenter Content="{x:Bind PaneContent}" />
    </SplitView>
</UserControl>
