<Page
    x:Class="BasicLibrarySamples.WrapPanelSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:BasicLibrarySamples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1="using:C1.Xaml"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
    <Page.Resources>
        <Style x:Key="BorderStyle" TargetType="Border">
            <Setter Property="Margin" Value="0 0 4 4" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="BorderThickness" Value="0" />
        </Style>
        <Style x:Key="LinkStyle" TargetType="HyperlinkButton">
            <Setter Property="Foreground" Value="White" />
        </Style>
    </Page.Resources>
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="0" />
        </Grid.ColumnDefinitions>
        <StackPanel Orientation="Horizontal" Margin="0 0 0 20">
            <TextBlock Text="Orientation:" Margin="0 0 5 0" VerticalAlignment="Center" FontSize="16" />
            <ComboBox x:Name="comboOrientation"  Width="200" SelectionChanged="comboOrientation_SelectionChanged">
                <ComboBoxItem>Horizontal</ComboBoxItem>
                <ComboBoxItem>Vertical</ComboBoxItem>
            </ComboBox>
        </StackPanel>
        
        <ScrollViewer x:Name="scroll" Grid.Row="1">
            <c1:C1WrapPanel x:Name="panel" Orientation="Horizontal">
                <Border Style="{StaticResource BorderStyle}" Background="#FF01ADD5">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="One Text" FontSize="25" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFA6DDFB">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="A larger text used for wrapping scenarios" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FF01ADD5">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="A name" FontSize="20"/>
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#328BBB">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Something else" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FF9DCCCF">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Should I break?" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFDFAB20" c1:C1WrapPanel.BreakLine="After">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Break After" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFDFEFEF">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Another name" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFA6DDFB">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Content cannot be repeated" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FF9DCCCF">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Empty" FontSize="20"  />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFDFAB20" c1:C1WrapPanel.BreakLine="Before">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Break Before" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FF328BBB">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Components" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FF01ADD5">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Controls" FontSize="8" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFDFEFEF">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Helps authors" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FF328BBB">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Tools" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFDFEFEF">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Any other word" FontSize="18" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFDFAB20" c1:C1WrapPanel.BreakLine="AfterAndBefore">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Break After and Before" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FF01ADD5">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Large sentences are really difficult to write" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FF9DCCCF">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Small font size is not recommended" FontSize="6" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFA6DDFB" >
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="Almost there" />
                </Border>
                <Border Style="{StaticResource BorderStyle}" Background="#FFDFEFEF">
                    <HyperlinkButton Style="{StaticResource LinkStyle}" Content="The End" FontSize="24" />
                </Border>
            </c1:C1WrapPanel>
        </ScrollViewer>
    </Grid>
</Page>
