<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:vm="clr-namespace:WindowsPhone.Recipes.Push.Server.ViewModels"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
                    xmlns:behaviors="clr-namespace:WindowsPhone.Recipes.Push.Server.Behaviors"
                    mc:Ignorable="d">

    <DataTemplate DataType="{x:Type vm:OneTimePushPatternViewModel}">
        <Border Style="{DynamicResource ViewBorderStyle}">
            <Grid d:LayoutOverrides="Width">                
                <HeaderedContentControl Width="Auto" VerticalAlignment="Top">
                    <HeaderedContentControl.Header>
                        <CheckBox Content="Tile Message" FontWeight="Bold" Foreground="{StaticResource ViewTextBrush}" IsChecked="{Binding IsTileEnabled, Mode=TwoWay}" />
                    </HeaderedContentControl.Header>
                    <Grid Height="Auto">
                        <StackPanel Margin="0,0,185,84">
                            <TextBlock Text="Count" Margin="4" />
                            <Slider Minimum="0" Maximum="99" IsSnapToTickEnabled="True" TickFrequency="1" AutoToolTipPlacement="BottomRight" Value="{Binding Count, UpdateSourceTrigger=PropertyChanged}" />
                            <TextBlock Text="Title" Margin="4" />
                            <TextBox TextWrapping="Wrap" Margin="4" Text="{Binding Title, UpdateSourceTrigger=PropertyChanged}" />
                        </StackPanel>

                        <ListBox ItemsSource="{Binding TileImages}"
                                 SelectedItem="{Binding BackgroundImageUri}"
                                 Margin="0,0,0,-63"
                                 VerticalAlignment="Bottom"
                                 HorizontalAlignment="Right"
                                 Width="183"
                                 BorderThickness="0" Background="Transparent"
                                 ItemContainerStyle="{DynamicResource ImageListBoxItemStyle}">
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Image x:Name="image" Source="{Binding}" Width="48" Height="48" Stretch="UniformToFill" />                                    
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ListBox>
                        
                        <Border BorderThickness="5" BorderBrush="#FFDEDEDE" Background="#FF333333" HorizontalAlignment="Right" VerticalAlignment="Center">
                            <Grid Width="173" Height="173">
                                <Image Source="{Binding BackgroundImageUri, Converter={StaticResource NullTileImageConverter}}" Stretch="UniformToFill" />
                                <Grid x:Name="counter" HorizontalAlignment="Right" Height="30.733" Margin="0,12,12,0" VerticalAlignment="Top" Width="30.733">
                                    <Ellipse Fill="Black" HorizontalAlignment="Stretch" Height="Auto" Margin="0" Stroke="Black" VerticalAlignment="Stretch" Width="Auto" StrokeThickness="0"/>
                                    <TextBlock HorizontalAlignment="Center" Height="Auto" TextWrapping="Wrap" Text="{Binding Count}" VerticalAlignment="Stretch" Width="Auto" TextAlignment="Center" FontSize="21.333" d:LayoutOverrides="Height" Margin="0,-0.321,0,2.679"/>
                                </Grid>
                                <TextBlock Height="22" TextWrapping="NoWrap" Text="{Binding Title}" VerticalAlignment="Bottom" Margin="6,0,6,6" FontSize="18.667" FontWeight="Bold" Width="158" HorizontalAlignment="Center"/>                                
                            </Grid>
                        </Border>
                    </Grid>
                </HeaderedContentControl>

                <HeaderedContentControl Width="Auto" HorizontalContentAlignment="Stretch" Margin="0,130.6,184,0" VerticalAlignment="Top">
                    <HeaderedContentControl.Header>
                        <CheckBox Content="Raw Message" FontWeight="Bold" Foreground="{StaticResource ViewTextBrush}" IsChecked="{Binding IsRawEnabled, Mode=TwoWay}" />
                    </HeaderedContentControl.Header>
                    <StackPanel Margin="4">
                        <TextBlock Text="Raw Message" Margin="4" />
                        <TextBox Margin="4" Text="{Binding RawMessage, UpdateSourceTrigger=PropertyChanged}" />
                    </StackPanel>
                </HeaderedContentControl>

                <HeaderedContentControl Width="Auto" Margin="0,215.52,184,0" VerticalAlignment="Stretch" d:LayoutOverrides="Height">
                    <HeaderedContentControl.Header>
                        <CheckBox Content="Toast Message" FontWeight="Bold" Foreground="{StaticResource ViewTextBrush}" IsChecked="{Binding IsToastEnabled, Mode=TwoWay}" />
                    </HeaderedContentControl.Header>
                    <StackPanel Margin="4">
                        <TextBlock Text="Title" Margin="4" />
                        <TextBox Margin="4" Text="{Binding ToastTitle, UpdateSourceTrigger=PropertyChanged}" />

                        <TextBlock Text="Subtitle" Margin="4" />
                        <TextBox Margin="4" Text="{Binding ToastSubTitle, UpdateSourceTrigger=PropertyChanged}" />
                    </StackPanel>
                </HeaderedContentControl>
                
                <Button Content="Send" Height="Auto" Command="{Binding SendCommand}" VerticalAlignment="Bottom" d:LayoutOverrides="GridBox" Width="64" RenderTransformOrigin="2.643,1.088" HorizontalAlignment="Right" Margin="0,0,0,2.68" />

            </Grid>
        </Border>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Count}" Value="0">
                <Setter TargetName="counter" Property="Visibility" Value="Hidden" />
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

</ResourceDictionary>