Skip to content

Commit 7ae98c6

Browse files
committed
Removed bouncing MarqueeBehavior in uno for MarqueeText
1 parent 59e0dfd commit 7ae98c6

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

labs/MarqueeText/src/MarqueeBehavior.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ public enum MarqueeBehavior
2222
/// </remarks>
2323
Looping,
2424

25+
#if !HAS_UNO
2526
/// <summary>
2627
/// The text bounces back and forth across the screen.
2728
/// </summary>
2829
Bouncing,
30+
#endif
2931
}

labs/MarqueeText/src/MarqueeText.Properties.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,17 @@ public MarqueeBehavior Behavior
6969

7070
private bool IsLooping => Behavior == MarqueeBehavior.Looping;
7171

72+
#if !HAS_UNO
7273
private bool IsBouncing => Behavior == MarqueeBehavior.Bouncing;
74+
#else
75+
private bool IsBouncing => false;
76+
#endif
7377

7478
/// <summary>
7579
/// Gets or sets a value indicating whether or not the marquee text wraps.
7680
/// </summary>
7781
/// <remarks>
78-
/// Wrappping text won't scroll if the text can already fit in the screen.
82+
/// Wrapping text won't scroll if the text can already fit in the screen.
7983
/// </remarks>
8084
public MarqueeDirection Direction
8185
{
@@ -125,8 +129,8 @@ private static void DirectionPropertyChanged(DependencyObject d, DependencyPrope
125129
bool active = control._isActive;
126130
var oldDirection = (MarqueeDirection)e.OldValue;
127131
var newDirection = (MarqueeDirection)e.NewValue;
128-
bool oldAxisX = oldDirection == MarqueeDirection.Left || oldDirection == MarqueeDirection.Right;
129-
bool newAxisX = newDirection == MarqueeDirection.Left || newDirection == MarqueeDirection.Right;
132+
bool oldAxisX = oldDirection is MarqueeDirection.Left or MarqueeDirection.Right;
133+
bool newAxisX = newDirection is MarqueeDirection.Left or MarqueeDirection.Right;
130134

131135
VisualStateManager.GoToState(control, GetVisualStateName(newDirection), true);
132136

labs/MarqueeText/src/MarqueeText.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ private static string GetVisualStateName(MarqueeBehavior behavior)
9393
{
9494
MarqueeBehavior.Ticker => TickerVisualStateName,
9595
MarqueeBehavior.Looping => LoopingVisualStateName,
96+
#if !HAS_UNO
9697
MarqueeBehavior.Bouncing => BouncingVisualStateName,
98+
#endif
9799
_ => TickerVisualStateName,
98100
};
99101
}
@@ -223,7 +225,9 @@ _segment1 is null ||
223225
{
224226
Duration = duration,
225227
RepeatBehavior = RepeatBehavior,
228+
#if !HAS_UNO
226229
AutoReverse = IsBouncing,
230+
#endif
227231
};
228232

229233
_marqueeStoryboard.Completed += StoryBoard_Completed;
@@ -232,7 +236,9 @@ _segment1 is null ||
232236
{
233237
Duration = duration,
234238
RepeatBehavior = RepeatBehavior,
239+
#if !HAS_UNO
235240
AutoReverse = IsBouncing,
241+
#endif
236242
};
237243
var frame1 = new DiscreteDoubleKeyFrame
238244
{

0 commit comments

Comments
 (0)