<Page
    x:Class="BasicLibrarySamples.NumericBoxSample"
    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="controlCaptionStyle"  TargetType="TextBlock">
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="10"/>
            <Setter Property="FontSize" Value="14"/>
        </Style>

        <Style x:Key="numericBoxStyle" TargetType="c1:C1NumericBox">
            <Setter Property="Margin" Value="0, 6, 6, 6"/>
        </Style>
    </Page.Resources>

    <Grid>
        <Grid HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition x:Name="column" Width="300"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <TextBlock Text="Number (N2)" Style="{StaticResource controlCaptionStyle}"/>
            <c1:C1NumericBox Grid.Column="1" Format="N2" Value="753678.25" Style="{StaticResource numericBoxStyle}"/>

            <TextBlock Grid.Row="1" Text="Fixed (F2)" Style="{StaticResource controlCaptionStyle}"/>
            <c1:C1NumericBox Grid.Row="1" Grid.Column="1" Format="F2"  Value="753678.25" Style="{StaticResource numericBoxStyle}"/>

            <TextBlock Grid.Row="2" Text="Currency (C2)" Style="{StaticResource controlCaptionStyle}"/>
            <c1:C1NumericBox Grid.Row="2" Grid.Column="1" Format="C2"  Value="99" Style="{StaticResource numericBoxStyle}"/>

            <TextBlock Grid.Row="3" Text="Percent (P0)" Style="{StaticResource controlCaptionStyle}"/>
            <c1:C1NumericBox Grid.Row="3" Grid.Column="1" Format="P0"  Value="0.75" Style="{StaticResource numericBoxStyle}"/>

            <TextBlock Grid.Row="4" Text="Custom (#,#.00)" Style="{StaticResource controlCaptionStyle}"/>
            <c1:C1NumericBox Grid.Row="4" Grid.Column="1" Format="#,#.00"  Value="23567.3" Style="{StaticResource numericBoxStyle}"/>

        </Grid>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="NarrowLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="0">
                        </AdaptiveTrigger>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="column.Width" Value="200"></Setter>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="WideLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowWidth="540">
                        </AdaptiveTrigger>
                    </VisualState.StateTriggers>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Page>
