| 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | xmlns:local="clr-namespace:UI.Controls.Base"> |
| 4 | <Style TargetType="{x:Type local:Img}"> |
| 5 | <Setter Property="SnapsToDevicePixels" |
| 6 | Value="true" /> |
| 7 | |
| 8 | <Setter Property="MinWidth" Value="18"/> |
| 9 | <Setter Property="MinHeight" Value="18"/> |
| 10 | <Setter Property="FontSize" Value="16"/> |
| 11 | <Setter Property="Radius" Value="5"/> |
| 12 | <Setter Property="Background" Value="Transparent"/> |
| 13 | |
| 14 | <Setter Property="Template"> |
| 15 | <Setter.Value> |
| 16 | <ControlTemplate TargetType="{x:Type local:Img}"> |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | <Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" CornerRadius="{TemplateBinding Radius}"> |
| 22 | <Border.Background> |
| 23 | <ImageBrush Stretch="Fill" x:Name="image" ImageSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:Img}}, Path=Src}"/> |
| 24 | </Border.Background> |
| 25 | </Border> |
| 26 | |
| 27 | </ControlTemplate> |
| 28 | </Setter.Value> |
| 29 | </Setter> |
| 30 | </Style> |
| 31 | </ResourceDictionary> |