mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
100 lines
6.8 KiB
XML
100 lines
6.8 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:controls="clr-namespace:AIStudio.Wpf.DiagramDesigner.Additionals.Controls"
|
|
xmlns:o="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">
|
|
|
|
<Geometry o:Freeze="True" x:Key="LeftGeometry">M394.24 512L683.52 248.32c10.24-10.24 10.24-25.6 0-35.84-10.24-10.24-25.6-10.24-35.84 0l-307.2 279.04c-5.12 5.12-7.68 12.8-7.68 20.48 0 7.68 2.56 15.36 7.68 20.48l307.2 279.04c10.24 10.24 25.6 10.24 35.84 0 10.24-10.24 10.24-25.6 0-35.84L394.24 512z</Geometry>
|
|
<Geometry o:Freeze="True" x:Key="RightGeometry">M4.1666641,0 C5.2083321,0 6.25,0.41666794 7.0833321,1.25 L57.083331,46.666664 C57.916664,47.499998 58.33333,48.749998 58.333329,49.999998 58.33333,51.249997 57.916664,52.499997 57.083331,53.333331 L7.0833321,98.749996 C5.4166641,100.41666 2.9166641,100.41666 1.2499962,98.749996 -0.41666794,97.083328 -0.41666794,94.583328 1.2499962,92.916664 L48.333331,49.999998 1.2499962,7.0833321 C-0.41666794,5.4166641 -0.41666794,2.9166641 1.2499962,1.25 2.0833282,0.41666794 3.1249962,0 4.1666641,0 z</Geometry>
|
|
|
|
<Style x:Key="CarouselListBoxItemStyle" TargetType="ListBoxItem">
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
|
|
<Setter Property="Padding" Value="0"/>
|
|
<Setter Property="Height" Value="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=ItemsControl}}"/>
|
|
</Style>
|
|
|
|
<ItemsPanelTemplate x:Key="CarouselListBoxItemPanelTemplate">
|
|
<StackPanel FocusVisualStyle="{x:Null}" Orientation="Horizontal" HorizontalAlignment="Left"/>
|
|
</ItemsPanelTemplate>
|
|
|
|
<Style x:Key="CarouselListBox" TargetType="ListBox">
|
|
<Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="False"/>
|
|
<Setter Property="ItemsPanel" Value="{StaticResource CarouselListBoxItemPanelTemplate}"/>
|
|
<Setter Property="ItemContainerStyle" Value="{StaticResource CarouselListBoxItemStyle}"/>
|
|
</Style>
|
|
|
|
<Style x:Key="CarouselPateButton" TargetType="RadioButton">
|
|
<Setter Property="Margin" Value="5,0"/>
|
|
<Setter Property="Width" Value="10"/>
|
|
<Setter Property="Height" Value="10"/>
|
|
<Setter Property="Background" Value="White"/>
|
|
<Setter Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=controls:Carousel}}"/>
|
|
<Setter Property="Padding" Value="0"/>
|
|
<Setter Property="BorderThickness" Value="1"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
<Border CornerRadius="5" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"/>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Opacity" Value=".9"/>
|
|
</Trigger>
|
|
<Trigger Property="IsPressed" Value="True">
|
|
<Setter Property="Opacity" Value=".6"/>
|
|
</Trigger>
|
|
<Trigger Property="IsChecked" Value="True">
|
|
<Setter Property="Background" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource Mode=Self}}"/>
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="CarouselStyle" TargetType="controls:Carousel" BasedOn="{StaticResource CarouselListBox}">
|
|
<Setter Property="PageButtonStyle" Value="{StaticResource CarouselPateButton}"/>
|
|
<Setter Property="Background" Value="White"/>
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="controls:Carousel">
|
|
<ControlTemplate.Triggers>
|
|
<EventTrigger RoutedEvent="FrameworkElement.MouseEnter">
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation Storyboard.TargetName="GridTop" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:.1"/>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
<EventTrigger RoutedEvent="FrameworkElement.MouseLeave">
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation Storyboard.TargetName="GridTop" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:.1"/>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
</ControlTemplate.Triggers>
|
|
<Grid ClipToBounds="True">
|
|
<ItemsPresenter x:Name="PART_ItemsControl" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Left"/>
|
|
<Grid x:Name="GridTop" Opacity="0">
|
|
<Button x:Name="Part_PreButton" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="30,0,0,0" Style="{StaticResource AIStudio.Styles.Button.Plain}">
|
|
<Border Width="50" Height="100" Background="{TemplateBinding Background}" CornerRadius="4">
|
|
<Path Margin="16" Fill="White" Data="{StaticResource LeftGeometry}" Stretch="Uniform"/>
|
|
</Border>
|
|
</Button>
|
|
<Button x:Name="Part_NextButton" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,30,0" Style="{StaticResource AIStudio.Styles.Button.Plain}">
|
|
<Border Width="50" Height="100" Background="{TemplateBinding Background}" CornerRadius="4">
|
|
<Path Margin="16" Fill="White" Data="{StaticResource RightGeometry}" Stretch="Uniform"/>
|
|
</Border>
|
|
</Button>
|
|
</Grid>
|
|
<StackPanel Name="PART_PanelPage" Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,20"/>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style BasedOn="{StaticResource CarouselStyle}" TargetType="{x:Type controls:Carousel}"/>
|
|
|
|
</ResourceDictionary> |