<Styles xmlns:iconPack="clr-namespace:PSCHelpdesk.Shared"
        xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Design.PreviewWith>
    <Border Padding="20">
      <iconPack:IconControl Width="20" Height="20" Background="Red" Foreground="Blue" Kind="PackIconEntypoKind.Calendar" />
    </Border>
  </Design.PreviewWith>

  <Style Selector="iconPack|IconControl">
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="VerticalAlignment" Value="Center" />

    <Setter Property="Template">
      <ControlTemplate TargetType="iconPack:IconControl">
        <Border Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}">
          <Grid x:Name="PART_InnerGrid"
                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                Margin="{TemplateBinding BorderThickness}">
           
            <Viewbox Margin="{TemplateBinding Padding}">
              <Path x:Name="PART_IconPath"
                    Stretch="Uniform"
                    UseLayoutRounding="False"
                    Fill="{TemplateBinding Foreground}"
                    Data="{Binding IconData, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                    />
            </Viewbox>
          </Grid>
        </Border>
      </ControlTemplate>
    </Setter>
  </Style>
</Styles>