<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:viewmodel="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Extensions.ViewModels" 
                    xmlns:gif="http://wpfanimatedgif.codeplex.com" 
                    xmlns:converter="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Converters"
                    xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Controls"
                    xmlns:dd="https://gitee.com/akwkevin/aistudio.-wpf.-diagram"
                    xmlns:Fluent="urn:fluent-ribbon"
                    xmlns:i="http://schemas.microsoft.com/xaml/behaviors">

    <dd:BoolVisibilityConverter x:Key="BoolVisibilityConverter"/>
    <converter:DoubleToThickness x:Key="DoubleToThickness"/>
    <dd:ColorBrushConverter x:Key="ColorBrushConverter"/>


    <DataTemplate DataType="{x:Type viewmodel:BarcodeDesignerItemViewModel}">
        <Viewbox Stretch="Fill" IsHitTestVisible="False">
            <controls:Barcode Width="{Binding ItemWidth}" Height="{Binding ItemHeight}" Padding="{Binding Margin,Converter={StaticResource DoubleToThickness}}" Text="{Binding Text}" Icon="{Binding Icon}" Format="{Binding Format}"/>
        </Viewbox>
    </DataTemplate>

    <!-- DataTemplate for Popup look and feel -->
    <DataTemplate DataType="{x:Type viewmodel:BarcodeDesignerItemData}">
        <Grid Width="550">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="20" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0"
                   Content="网页链接"
                   Margin="5" />
            <DockPanel Grid.Row="1" >
                <Border BorderThickness="1" BorderBrush="Black" Margin="5" DockPanel.Dock="Right">
                    <controls:Barcode Text="{Binding Text}" Icon="{Binding Icon}" Format="{Binding Format}" Width="140" Height="140" Padding="{Binding Margin,Converter={StaticResource DoubleToThickness}}" />
                </Border>
                <TextBox  Text="{Binding Text,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap" DockPanel.Dock="Left" Margin="5"/>
            </DockPanel>
            <StackPanel Grid.Row="2" Orientation="Horizontal">
                <TextBlock Text="边界：" Margin="5" HorizontalAlignment="Center"/>
                <Fluent:Spinner Margin="5" DockPanel.Dock="Right" Width="60" Size="Small" Value="{Binding Margin}" Maximum="25" Minimum="0" Format="0 px" />
            </StackPanel>
            <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Margin="5,5,50,5" Content="上传Logo" Command="{Binding UploadCommand}" />
            </StackPanel>
        </Grid>
    </DataTemplate>
</ResourceDictionary>