<Page
    x:Class="AmbientSounds.Views.ShellPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:c="using:AmbientSounds.Converters"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="using:AmbientSounds.Views"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="using:Microsoft.Toolkit.Uwp.UI.Controls"
    x:Name="RootPage"
    Background="{ThemeResource FallbackBackgroundBrush}"
    mc:Ignorable="d">
    <Grid>
        <toolkit:ImageEx
            x:Name="BackgroundImage"
            x:Load="{x:Bind ViewModel.ShowBackgroundImage, Mode=OneWay}"
            IsCacheEnabled="True"
            Source="{x:Bind ViewModel.BackgroundImagePath, Mode=OneWay}"
            Stretch="UniformToFill" />
        <Rectangle
            x:Name="ImageMask"
            x:Load="{x:Bind ViewModel.ShowBackgroundImage, Mode=OneWay}"
            Fill="{ThemeResource FallbackBackgroundBrush}"
            Opacity="0.3"
            Stretch="UniformToFill" />

        <Frame x:Name="MainFrame" />

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="NormalState" />
                <VisualState x:Name="TransparencyOnState">
                    <VisualState.Setters>
                        <Setter Target="RootPage.Background" Value="{ThemeResource SystemControlAcrylicWindowBrush}" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>
