Files
Shrlalgo.RvKits/Wpf.Ui.Extend/Controls/RunningLine/RunningLine.xaml
2024-09-22 11:05:41 +08:00

44 lines
2.3 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:exc="clr-namespace:Wpf.Ui.Extend.Controls">
<Style x:Key="DefaultRunningLineStyle" TargetType="{x:Type exc:RunningLine}">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type exc:RunningLine}">
<Canvas
x:Name="RootCanvas"
Height="{TemplateBinding ActualHeight}"
Background="{TemplateBinding Background}">
<ItemsControl
x:Name="RootPanel"
Height="{TemplateBinding ActualHeight}"
ItemTemplate="{TemplateBinding LineTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorType=exc:RunningLine}}" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<ItemsControl
x:Name="RootPanelNext"
Height="{TemplateBinding ActualHeight}"
ItemTemplate="{TemplateBinding LineTemplate}"
Visibility="Hidden">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorType=exc:RunningLine}}" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</Canvas>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource DefaultRunningLineStyle}" TargetType="{x:Type exc:RunningLine}" />
</ResourceDictionary>