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