Skip to content

Commit efe51f9

Browse files
committed
Updated sample to include AutoPlay and speed. Also inverted hovering demo to display pausing with hyperlinks.
1 parent cfe7db2 commit efe51f9

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

components/Marquee/samples/Marquee.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@ The repeat behavior determines how many times the marquee will loop before the a
4343

4444
The default direction is left, meaning the content will move leftwards, but this can be changed to right, up, or down. Direction changed between left and right or up and down are handled continously, meaning that the animation will resume from its current position if changed between these directions.
4545

46+
## Speed
47+
48+
The speed property determines how quickly the content moves in pixels-per-second. The speed can be adjusted mid-animation and handled continously. Because the speed is in pixels per second the actual time it takes to scroll will depend on the size of the content. The content can also change size dynamically and the speed will remain constant.
49+
50+
## AutoPlay
51+
52+
The AutoPlay property determines if the marquee will start animating when it is loaded, upon on size changes, or when the content changes. If set to false the marquee can be started manually by calling the `StartMarquee` method.
53+
4654
> [!Sample MarqueeTextSample]
4755
4856
## Non-Text Content

components/Marquee/samples/MarqueeBehaviorSample.xaml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
1+
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
22
<Page x:Class="MarqueeExperiment.Samples.MarqueeBehaviorSample"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -31,23 +31,38 @@
3131

3232
<TextBlock Margin="0,16,0,0"
3333
FontWeight="Bold"
34-
Text="This Marquee will loop while hovered and pause when not hovered." />
34+
Text="This Marquee contains hyperlinks and will pause while hovered." />
3535
<controls:Marquee x:Name="MarqueeControl"
3636
Background="Transparent"
3737
Behavior="Looping"
38-
Content="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
3938
FontSize="18"
4039
RepeatBehavior="Forever"
40+
AutoPlay="True"
4141
Speed="96">
42+
<controls:Marquee.ContentTemplate>
43+
<DataTemplate>
44+
<StackPanel Spacing="4">
45+
<RichTextBlock>
46+
<Paragraph>
47+
<Run Text="Lorem ipsum dolor sit amet, "/>
48+
<Hyperlink>consectetur adipiscing elit</Hyperlink>
49+
<Run Text=", sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "/>
50+
<Hyperlink>Ut enim ad minim veniam</Hyperlink>
51+
<Run Text=", quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."/>
52+
</Paragraph>
53+
</RichTextBlock>
54+
</StackPanel>
55+
</DataTemplate>
56+
</controls:Marquee.ContentTemplate>
4257
<interactivity:Interaction.Behaviors>
4358
<interactivity:EventTriggerBehavior EventName="PointerEntered"
4459
SourceObject="{Binding ElementName=MarqueeControl}">
45-
<interactivity:CallMethodAction MethodName="StartMarquee"
60+
<interactivity:CallMethodAction MethodName="PauseMarquee"
4661
TargetObject="{Binding ElementName=MarqueeControl}" />
4762
</interactivity:EventTriggerBehavior>
4863
<interactivity:EventTriggerBehavior EventName="PointerExited"
4964
SourceObject="{Binding ElementName=MarqueeControl}">
50-
<interactivity:CallMethodAction MethodName="PauseMarquee"
65+
<interactivity:CallMethodAction MethodName="StartMarquee"
5166
TargetObject="{Binding ElementName=MarqueeControl}" />
5267
</interactivity:EventTriggerBehavior>
5368
</interactivity:Interaction.Behaviors>

0 commit comments

Comments
 (0)