<Page x:Class="FlexGridSamples.ExcelStyleMerge"
    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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1="using:C1.Xaml.FlexGrid"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="700">

    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <StackPanel Orientation="Horizontal" Margin="0 0 0 20">
            <Button x:Name="_btnMerge" Content="{Binding MergeCells_Content, Source={StaticResource FlexGridSamplesLocalization}}" Padding="6" Click="_btnMerge_Click" />
            <Button x:Name="_btnSplit" Margin="10,0,0,0" Content="{Binding SplitCells_Content, Source={StaticResource FlexGridSamplesLocalization}}" Padding="6" Click="_btnSplit_Click" />
        </StackPanel>

        <c1:C1FlexGrid x:Name="_flex" Grid.Row="1" ShowMarquee="True" BorderThickness="1" AutoGenerateColumns="True" GridLinesVisibility="All"/>
        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's window size -->
            <VisualStateGroup>
                <VisualState x:Name="WideLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="540" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                    </VisualState.Setters>
                </VisualState>

                <VisualState x:Name="NarrowLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0" />
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="_flex.FontSize" Value="10" />
                        <Setter Target="_btnMerge.FontSize" Value="10" />
                        <Setter Target="_btnMerge.Width" Value="120" />
                        <Setter Target="_btnSplit.FontSize" Value="10" />
                        <Setter Target="_btnSplit.Width" Value="100" />
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>
