<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:i="http://schemas.microsoft.com/xaml/behaviors">

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

    <ControlTemplate x:Key="infoButtonTemplate" TargetType="Button">
        <Grid x:Name="grid" Opacity="0.1">
            <Ellipse Width="16"
                     Height="16"
                     Stroke="Black"
                     StrokeThickness="2"
                     HorizontalAlignment="Center"
                     VerticalAlignment="Center"
                     Fill="White"/>
            <Label Content="i"
                   FontWeight="Bold"
                   FontStyle="Italic"
                   HorizontalAlignment="Center"
                   HorizontalContentAlignment="Center"
                   VerticalAlignment="Center"
                   VerticalContentAlignment="Center"
                   FontSize="12" />
        </Grid>

        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver"
                     Value="True">
                <Setter TargetName="grid"
                        Property="Opacity"
                        Value="1.0" />
            </Trigger>
        </ControlTemplate.Triggers>

    </ControlTemplate>  

    <!-- DataTemplate for DesignerCanvas look and feel -->
    <DataTemplate DataType="{x:Type viewmodel:PersistDesignerItemViewModel}">
        <Grid>
            <Image IsHitTestVisible="False"
                    Stretch="Fill"
                    Source="/AIStudio.Wpf.DiagramApp;component/Images/Persist.png"
                    Tag="setting" />
            <Button x:Name="btnSetting" HorizontalAlignment="Right"
                    VerticalAlignment="Bottom"
                    Margin="5"
                    Template="{StaticResource infoButtonTemplate}" 
                    Command="{Binding EditCommand}" />
        </Grid>
    </DataTemplate>

    <!-- DataTemplate for Popup look and feel -->
    <DataTemplate DataType="{x:Type viewmodel:PersistDesignerItemData}">
        <Grid Background="{DynamicResource Fluent.Ribbon.Brushes.AccentBaseColorBrush}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Label Grid.Row="0"
                   Content="HostUrl"
                   Margin="5" />
            <TextBox Grid.Row="1"
                    HorizontalAlignment="Left"
                    Text="{Binding HostUrl}"
                    Width="150"
                    Margin="5" />
        </Grid>
    </DataTemplate> 

</ResourceDictionary>