feat: add a border to template.
This commit is contained in:
@@ -25,6 +25,13 @@
|
||||
u:FormItem.Label="VerticalContentAlignment"
|
||||
EnumType="{x:Type VerticalAlignment}"
|
||||
Value="{x:Static VerticalAlignment.Center}" />
|
||||
<u:NumericDoubleUpDown
|
||||
Name="speed"
|
||||
AllowDrag="True"
|
||||
u:FormItem.Label="Speed"
|
||||
Minimum="1"
|
||||
Maximum="300"
|
||||
Value="60"/>
|
||||
<ToggleSwitch
|
||||
Name="running"
|
||||
u:FormItem.Label="IsRunning"
|
||||
@@ -35,6 +42,7 @@
|
||||
Height="100"
|
||||
HorizontalContentAlignment="{Binding #horizontal.Value}"
|
||||
VerticalContentAlignment="{Binding #vertical.Value}"
|
||||
Speed="{Binding #speed.Value}"
|
||||
Background="{DynamicResource SemiBlue1}"
|
||||
Direction="{Binding #direction.Value}"
|
||||
IsRunning="{Binding #running.IsChecked}">
|
||||
|
||||
@@ -7,12 +7,19 @@
|
||||
<ControlTheme x:Key="{x:Type u:Marquee}" TargetType="u:Marquee">
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Canvas Background="{TemplateBinding Background}">
|
||||
<ContentPresenter
|
||||
Name="{x:Static iri:PartNames.PART_ContentPresenter}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</Canvas>
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BackgroundSizing="{TemplateBinding BackgroundSizing}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}">
|
||||
<Canvas>
|
||||
<ContentPresenter
|
||||
Name="{x:Static iri:PartNames.PART_ContentPresenter}"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||
</Canvas>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
|
||||
@@ -114,7 +114,7 @@ public class Marquee : ContentControl
|
||||
{
|
||||
Canvas.SetTop(Presenter, location.Value.top);
|
||||
Canvas.SetLeft(Presenter, location.Value.left);
|
||||
}, DispatcherPriority.Background);
|
||||
}, DispatcherPriority.Render);
|
||||
}
|
||||
|
||||
private void InvalidatePresenterPosition()
|
||||
|
||||
Reference in New Issue
Block a user