Describe the bug
|
<Setter Property="VerticalAlignment" Value="Top" /> |
|
private void Container_SizeChanged(object sender, SizeChangedEventArgs e) |
|
_segment2.Visibility = IsLooping ? Visibility.Visible : Visibility.Collapsed; |
|
_segment2.Visibility = Visibility.Collapsed; |
I noticed that the Marquee control crashes. After debugging, I believe the SizeChanged event causes the visibility of segment2 to change. Since the control’s default vertical alignment is set to Top, this triggers another SizeChanged event, resulting in an infinite loop.
Setting VerticalAlignment="Stretch" allows it to work correctly, but this is not a real solution.
In addition, I noticed that _marqueeContainer is repeatedly subscribing to the SizeChanged event.
|
_marqueeContainer.SizeChanged += Container_SizeChanged; |
|
_marqueeContainer.SizeChanged += Container_SizeChanged; |
Steps to reproduce
<labs:Marquee
Behavior="Looping"
Content="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
Direction="Down"
FontSize="18"
RepeatBehavior="Forever"
Speed="200" />
Just setting Behavior="Looping" is enough to trigger the crash.
Expected behavior
This shouldn't cause the program to crash.
Screenshots
Code Platform
Windows Build Number
Other Windows Build number
No response
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
No response
Visual Studio Build Number
No response
Device form factor
No response
Additional context
No response
Describe the bug
Labs-Windows/components/Marquee/src/Marquee.xaml
Line 9 in acda1c3
Labs-Windows/components/Marquee/src/Marquee.Events.cs
Line 62 in acda1c3
Labs-Windows/components/Marquee/src/Marquee.cs
Line 241 in acda1c3
Labs-Windows/components/Marquee/src/Marquee.cs
Line 211 in acda1c3
I noticed that the Marquee control crashes. After debugging, I believe the SizeChanged event causes the visibility of segment2 to change. Since the control’s default vertical alignment is set to Top, this triggers another SizeChanged event, resulting in an infinite loop.
Setting VerticalAlignment="Stretch" allows it to work correctly, but this is not a real solution.
In addition, I noticed that _marqueeContainer is repeatedly subscribing to the SizeChanged event.
Labs-Windows/components/Marquee/src/Marquee.cs
Line 69 in acda1c3
Labs-Windows/components/Marquee/src/Marquee.Events.cs
Line 36 in acda1c3
Steps to reproduce
Expected behavior
This shouldn't cause the program to crash.
Screenshots
Code Platform
Windows Build Number
Other Windows Build number
No response
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
No response
Visual Studio Build Number
No response
Device form factor
No response
Additional context
No response