DragAndDrop core
This commit is contained in:
44
Lattice.UI.DragDrop.WinUI/Themes/DragAdorner.xaml
Normal file
44
Lattice.UI.DragDrop.WinUI/Themes/DragAdorner.xaml
Normal file
@@ -0,0 +1,44 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:Lattice.UI.DragDrop.WinUI.Controls"
|
||||
xmlns:media="using:Microsoft.UI.Xaml.Media">
|
||||
|
||||
<Style TargetType="controls:DragAdorner">
|
||||
<Setter Property="Background" Value="{ThemeResource Lattice.Brush.Background.Secondary}" />
|
||||
<Setter Property="BorderBrush" Value="{ThemeResource Lattice.Brush.Border.Primary}" />
|
||||
<Setter Property="BorderThickness" Value="{ThemeResource Lattice.BorderThickness.Thin}" />
|
||||
<Setter Property="Padding" Value="{ThemeResource Lattice.Spacing.Medium}" />
|
||||
<Setter Property="CornerRadius" Value="{ThemeResource Lattice.CornerRadius.Medium}" />
|
||||
<Setter Property="Opacity" Value="{ThemeResource Lattice.Opacity.Drag}" />
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:DragAdorner">
|
||||
<Grid>
|
||||
<!-- Фон с тенью -->
|
||||
<Rectangle
|
||||
x:Name="Background"
|
||||
Fill="{TemplateBinding Background}"
|
||||
Opacity="{TemplateBinding Opacity}"
|
||||
RadiusX="{TemplateBinding CornerRadius}"
|
||||
RadiusY="{TemplateBinding CornerRadius}">
|
||||
<Rectangle.Shadow>
|
||||
<media:ThemeShadow />
|
||||
</Rectangle.Shadow>
|
||||
</Rectangle>
|
||||
|
||||
<!-- Контент -->
|
||||
<ContentPresenter
|
||||
x:Name="PART_ContentPresenter"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Content="{TemplateBinding DragData}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user