qamp/Qrakhen.TilingFrames/Themes/Controls/DropArea.xaml

92 lines
3.4 KiB
XML

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Qrakhen.TilingFrames.Converters"
xmlns:local="clr-namespace:Qrakhen.TilingFrames.Controls.DropArea"
xmlns:dnd="clr-namespace:Qrakhen.TilingFrames.Controls.DragAndDrop"
xmlns:models="clr-namespace:Qrakhen.TilingFrames.Models">
<converters:AlphaRatioConverter x:Key="RatioToStarConverter" />
<Style x:Key="DropAreaButton" TargetType="{x:Type Button}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="AllowDrop" Value="True" />
<Setter Property="Background" Value="#10affefe" />
<Setter Property="Margin" Value="3" />
<Setter Property="Padding" Value="0" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Stretch" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.Setters>
<Setter Property="Background" Value="#40affefe" />
</Trigger.Setters>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="{x:Type local:DropArea}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:DropArea}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition Width="72" />
<ColumnDefinition Width="48" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="48" />
<RowDefinition Height="72" />
<RowDefinition Height="48" />
</Grid.RowDefinitions>
<Button x:Name="CenterDrop"
Drop="CenterDrop_Drop"
dnd:DragAndDropControl.IsDraggable="True"
dnd:DragAndDropControl.HAndler="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}}"
Style="{StaticResource DropAreaButton}"
Grid.Row="1"
Grid.Column="1" />
<Button x:Name="LeftDrop"
Drop="LeftDrop_Drop"
Style="{StaticResource DropAreaButton}"
Grid.Row="1"
Grid.Column="0" />
<Button x:Name="TopDrop"
Drop="TopDrop_Drop"
Style="{StaticResource DropAreaButton}"
Grid.Row="0"
Grid.Column="1" />
<Button x:Name="RightDrop"
Drop="RightDrop_Drop"
Style="{StaticResource DropAreaButton}"
Grid.Row="1"
Grid.Column="2" />
<Button x:Name="BottomDrop"
Drop="BottomDrop_Drop"
Style="{StaticResource DropAreaButton}"
Grid.Row="2"
Grid.Column="1" />
<Border BorderBrush="#affefe"
BorderThickness="1.28"
Grid.Column="1"
Grid.RowSpan="3" />
<Border BorderBrush="#affefe"
BorderThickness="1.28"
Grid.ColumnSpan="3"
Grid.Row="1" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>