<Page
    x:Class="Direct2DEffects.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Direct2DEffects"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Page.Resources>
        <ResourceDictionary>
            <local:Strings x:Key="Strings" />
        </ResourceDictionary>
    </Page.Resources>

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Margin="0,10,10,0" VerticalAlignment="Top" HorizontalAlignment="Right">
            <Button>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <TextBlock
                            x:Name="contentText"
                            Text="{Binding EffectsButtonText, Source={StaticResource Strings}}"
                            Margin="0, 0, 8, 0"
                            VerticalAlignment="Center"
                            />
                    <FontIcon
                            x:Name="contentIcon"
                            Grid.Column="1"
                            FontFamily="{ThemeResource SymbolThemeFontFamily}"
                            FontSize="16"
                            Glyph="&#xE0A1;"
                            />
                </Grid>
                <Button.Flyout>
                    <MenuFlyout>
                        <MenuFlyoutItem
                            Text="{Binding OriginalButtonText, Source={StaticResource Strings}}"
                            Click="Original_Click"
                            />
                        <MenuFlyoutItem
                            Text="{Binding GaussianBlurButtonText, Source={StaticResource Strings}}"
                            Click="GaussianBlur_Click"
                            />
                        <MenuFlyoutItem
                            Text="{Binding SharpenButtonText, Source={StaticResource Strings}}"
                            Click="Sharpen_Click"
                            />
                        <MenuFlyoutItem
                            Text="{Binding HorizontalSmearButtonText, Source={StaticResource Strings}}"
                            Click="HorizontalSmear_Click"
                            />
                        <MenuFlyoutItem
                            Text="{Binding ShadowButtonText, Source={StaticResource Strings}}"
                            Click="Shadow_Click"
                            />
                        <MenuFlyoutItem
                            Text="{Binding DisplacementMapButtonText, Source={StaticResource Strings}}"
                            Click="DisplacementMap_Click"
                            />
                        <MenuFlyoutItem
                            Text="{Binding EmbossButtonText, Source={StaticResource Strings}}"
                            Click="Emboss_Click"
                            />
                        <MenuFlyoutItem
                            Text="{Binding EdgeDetectButtonText, Source={StaticResource Strings}}"
                            Click="EdgeDetect_Click"
                            />
                        <MenuFlyoutItem
                            Text="{Binding SepiaButtonText, Source={StaticResource Strings}}"
                            Click="Sepia_Click"
                            />
                    </MenuFlyout>
                </Button.Flyout>
            </Button>
            <Button
                Content="{Binding ExportButtonText, Source={StaticResource Strings}}"
                Margin="10,0,0,0"
                Click="Export_Click"
                />
        </StackPanel>

        <Image x:Name="imageElement" Grid.Row="1" Stretch="Uniform" />

    </Grid>
</Page>
