<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:confirmations="clr-namespace:SteamLib.SteamMobile.Confirmations;assembly=SteamLibForked"
                    xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
                    xmlns:theme="clr-namespace:NebulaAuth.Theme"
                    xmlns:converters="clr-namespace:NebulaAuth.Converters"
                    xmlns:entities="clr-namespace:NebulaAuth.Model.Entities"
                    >


    <DataTemplate DataType="{x:Type confirmations:Confirmation}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition  Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <materialDesign:PackIcon  Width="20" Height="20" VerticalAlignment="Center" DockPanel.Dock="Left" Kind="QuestionMark" Margin="0,0,10,0"/>
            <TextBlock VerticalAlignment="Center" Grid.Column="1" Text="{Binding TypeName}"></TextBlock>
            <TextBlock VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right" Text="{Binding Time, StringFormat=t}"/>
            <Button Margin="5,0,0,0" VerticalAlignment="Center" Grid.Column="3" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ConfirmCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Check"></materialDesign:PackIcon>
            </Button>
            <Button Grid.Column="4" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.CancelCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Close" />
            </Button>
        </Grid>
    </DataTemplate>
    <DataTemplate DataType="{x:Type confirmations:TradeConfirmation}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <materialDesign:PackIcon VerticalAlignment="Center"   Width="20" Height="20"  Kind="AccountArrowRight" Margin="0,0,10,0"></materialDesign:PackIcon>
            <Image Grid.Column="1" VerticalAlignment="Center" DockPanel.Dock="Left" Width="24" Height="24" Source="{Binding UserAvatarUri}" Margin="0,0,10,0"></Image>
            <TextBlock VerticalAlignment="Center" Grid.Column="2"  TextWrapping="WrapWithOverflow" >
                <Run Text="{Tr MainWindow.ConfirmationTemplates.TradeWith, IsDynamic=False}"/>
                <Run Text="{Binding UserName}" FontWeight="Bold"></Run>
            </TextBlock>
            <materialDesign:PackIcon Grid.Column="3" HorizontalAlignment="Right"  VerticalAlignment="Center" Margin="5,0,5,0" Kind="Gift" Visibility="{Binding IsReceiveNothing, Converter={StaticResource BooleanToVisibilityConverter}}"/>
            <TextBlock VerticalAlignment="Center" Grid.Column="4" HorizontalAlignment="Right" Text="{Binding Time, StringFormat=t}"/>
            <Button Margin="5,0,0,0" VerticalAlignment="Center" Grid.Column="5" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ConfirmCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Check"></materialDesign:PackIcon>
            </Button>
            <Button Grid.Column="6" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.CancelCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Close" />
            </Button>
        </Grid>
    </DataTemplate>
    <DataTemplate DataType="{x:Type confirmations:AccountRecoveryConfirmation}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <materialDesign:PackIcon  Width="20" Height="20" VerticalAlignment="Center" DockPanel.Dock="Left" Kind="LockOutline" Margin="0,0,10,0"/>
            <TextBlock VerticalAlignment="Center" Grid.Column="1" Text="{Tr MainWindow.ConfirmationTemplates.Recovery}"/>
            <TextBlock VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right" Text="{Binding Time, StringFormat=t}"/>
            <Button Margin="5,0,0,0" VerticalAlignment="Center" Grid.Column="3" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ConfirmCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Check"></materialDesign:PackIcon>
            </Button>
            <Button Grid.Column="4" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.CancelCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Close" />
            </Button>
        </Grid>
    </DataTemplate>
    <DataTemplate DataType="{x:Type confirmations:MarketConfirmation}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <materialDesign:PackIcon VerticalAlignment="Center"   Width="20" Height="20"  Kind="ShoppingCart" Margin="0,0,10,0"></materialDesign:PackIcon>
            <Border Grid.Column="1" Background="{DynamicResource MaterialDesignPaper}" MaxHeight="36" HorizontalAlignment="Center" BorderBrush="{DynamicResource PrimaryHueMidBrush}" BorderThickness="0.6" Margin="0,0,10,0">
                 <Image  HorizontalAlignment="Center" VerticalAlignment="Center" MaxWidth="32" MaxHeight="32" Source="{Binding ItemImageUri}" ></Image>
            </Border>
            <Grid Grid.Column="2">
                <TextBlock VerticalAlignment="Center" x:Name="ItemName" theme:FontScaleWindow.ResizeFont="True" TextWrapping="WrapWithOverflow"  Text="{Binding ItemName}"/> 
           
                <TextBlock Grid.Row="1" Foreground="LightGray" Text="{Binding PriceString}">
                    <TextBlock.FontSize>
                        <Binding ElementName="ItemName" Path="FontSize" ConverterParameter="0.7">
                            <Binding.Converter>
                                <converters:CoefficientConverter/>
                            </Binding.Converter>
                        </Binding>
                    </TextBlock.FontSize>
                </TextBlock>
            </Grid>

            <TextBlock VerticalAlignment="Center"  Grid.Column="4" HorizontalAlignment="Left" Margin="5,0,0,0" Text="{Binding Time, StringFormat=t}"/>
            <Button Margin="5,0,0,0" VerticalAlignment="Center" Grid.Column="5" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ConfirmCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Check"></materialDesign:PackIcon>
            </Button>
            <Button Grid.Column="6" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.CancelCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Close" />
            </Button>
        </Grid>
    </DataTemplate>
    <DataTemplate DataType="{x:Type confirmations:RegisterApiKeyConfirmation}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <materialDesign:PackIcon  Width="20" Height="20" VerticalAlignment="Center" DockPanel.Dock="Left" Kind="KeyLink" Margin="0,0,10,0"/>
            <TextBlock VerticalAlignment="Center" Grid.Column="1" Text="{Tr MainWindow.ConfirmationTemplates.ApiKey}"></TextBlock>
            <TextBlock VerticalAlignment="Center" Grid.Column="2" HorizontalAlignment="Right" Text="{Binding Time, StringFormat=t}"/>
            <Button Margin="5,0,0,0" VerticalAlignment="Center" Grid.Column="3" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ConfirmCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Check"></materialDesign:PackIcon>
            </Button>
            <Button Grid.Column="4" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.CancelCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Close" />
            </Button>
        </Grid>
    </DataTemplate>
    <DataTemplate DataType="{x:Type entities:MarketMultiConfirmation}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <materialDesign:PackIcon VerticalAlignment="Center"   Width="20" Height="20"  Kind="ShoppingCartPlus" Margin="0,0,10,0"></materialDesign:PackIcon>
            <TextBlock VerticalAlignment="Center" Grid.Column="1">
                <Run Text="{Tr MainWindow.ConfirmationTemplates.Market, IsDynamic=False}"/>
                <Run Text="{Binding Confirmations.Count, Mode=OneWay}"/>
                <Run Text="{Tr Common.Abbreviations.Count.Items, IsDynamic=False}"/>
            </TextBlock>

            <TextBlock VerticalAlignment="Center"  Grid.Column="2" HorizontalAlignment="Left" Margin="5,0,0,0" Text="{Binding Time, StringFormat=t}"/>
            <Button Margin="5,0,0,0" VerticalAlignment="Center" Grid.Column="3" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.ConfirmCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Check"></materialDesign:PackIcon>
            </Button>
            <Button Grid.Column="4" Style="{StaticResource MaterialDesignIconButton}"
                    Command="{Binding RelativeSource={RelativeSource AncestorType=Window}, Path=DataContext.CancelCommand}"
                    CommandParameter="{Binding }">
                <materialDesign:PackIcon Kind="Close" />
            </Button>
        </Grid>
    </DataTemplate>
</ResourceDictionary>