View Issue Details

IDProjectCategoryView StatusLast Update
0002578NoesisGUIUnity3Dpublic2023-08-23 19:09
Reporterstonstad Assigned Tosfernandez  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.0 
Target Version3.2.2Fixed in Version3.2.2 
Summary0002578: Unwanted Blur Effect Margin Behavior
DescriptionIn Noesis 3.2, when a blur effect is applied to the top-level user control the UI is shown off-screen. See video here: https://tonstad.blob.core.windows.net/media/Movie_024.mp4

The blur radius in the example shown is 25, which is equal to the offset behavior shown.

I am including the code used to enable and disable the blur effect. Note that if I comment out storyboard.Begin() in the enclosed code, the behavior does not manifest.

It is isolated to the storyboard begin behavior. No other code appears to be responsible for the behavior. This behavior is new to Noesis 3.2.

Encl. FrameworkExtensionMethods.cs.

TagsNo tags attached.
PlatformAny

Relationships

related to 0002615 resolvedsfernandez BackgroundEffect behavior being invalidated per frame 

Activities

stonstad

stonstad

2023-04-23 18:03

reporter  

FrameworkExtentionMethods.cs (3,525 bytes)   
public static void Unblur(this FrameworkElement frameworkElement, FrameworkElement parent, TimeSpan duration, Action completed = null)
        {
            if (!(frameworkElement.Effect is BlurEffect blurEffect))
                return;

            string key = "Blur" + frameworkElement.GetHashCode();

            if (frameworkElement.Tag is StoryboardTag tag)
            {
                tag.Item1.Stop();
                parent.Resources.Remove(key);
            }

            float from = blurEffect.Radius;

            DoubleAnimation animation = new DoubleAnimation();
            animation.Duration = new Duration(duration);
            animation.AutoReverse = false;
            animation.FillBehavior = FillBehavior.Stop;

            Storyboard storyboard = new Storyboard();
            storyboard.AutoReverse = false;
            storyboard.Duration = animation.Duration;
            storyboard.FillBehavior = FillBehavior.Stop;
            storyboard.Children.Add(animation);

            parent.Resources.Add(key, storyboard);
            frameworkElement.Tag = new StoryboardTag(storyboard, 1);

            Storyboard.SetTarget(animation, frameworkElement);
            Storyboard.SetTargetProperty(animation, new PropertyPath("Effect.Radius"));
            animation.From = from;
            animation.To = 0;
            storyboard.Completed += (sender2, e2) =>
            {
                parent.Resources.Remove(key);
                frameworkElement.Tag = null;
                blurEffect.Radius = 0;
                frameworkElement.Effect = null;
                completed?.Invoke();
            };

            storyboard.Begin();
        }

        public static void Blur(this FrameworkElement frameworkElement, FrameworkElement parent, float radius, TimeSpan duration, Action completed = null)
        {
            if (!(frameworkElement.Effect is BlurEffect blurEffect))
            {
                blurEffect = new BlurEffect();
                frameworkElement.Effect = blurEffect;
            }

            string key = "Blur" + frameworkElement.GetHashCode();

            if (frameworkElement.Tag is StoryboardTag tag)
            {
                tag.Item1.Stop();
                parent.Resources.Remove(key);
            }

            float from = blurEffect.Radius;

            DoubleAnimation animation = new DoubleAnimation();
            animation.Duration = new Duration(duration);
            animation.AutoReverse = false;
            animation.FillBehavior = FillBehavior.Stop;

            Storyboard storyboard = new Storyboard();
            storyboard.AutoReverse = false;
            storyboard.Duration = animation.Duration;
            storyboard.FillBehavior = FillBehavior.Stop;
            storyboard.Children.Add(animation);

            parent.Resources.Add(key, storyboard);
            frameworkElement.Tag = new StoryboardTag(storyboard, 1);

            Storyboard.SetTarget(animation, frameworkElement);
            Storyboard.SetTargetProperty(animation, new PropertyPath("Effect.Radius"));
            animation.From = from;
            animation.To = radius;
            storyboard.Completed += (sender2, e2) =>
            {
                parent.Resources.Remove(key);
                frameworkElement.Tag = null;
                blurEffect.Radius = radius;
                completed?.Invoke();
            };

            storyboard.Begin();
        }
FrameworkExtentionMethods.cs (3,525 bytes)   
sfernandez

sfernandez

2023-08-23 19:08

manager   ~0008663

Resolved in changesets 12541 and 12542

Issue History

Date Modified Username Field Change
2023-04-23 18:03 stonstad New Issue
2023-04-23 18:03 stonstad File Added: FrameworkExtentionMethods.cs
2023-05-02 11:56 sfernandez Assigned To => sfernandez
2023-05-02 11:56 sfernandez Status new => assigned
2023-05-02 11:56 sfernandez Product Version 3.2 => 3.2.0
2023-05-02 11:56 sfernandez Target Version => 3.2.1
2023-05-10 00:14 jsantos Target Version 3.2.1 => 3.2.2
2023-08-23 19:07 sfernandez Relationship added related to 0002615
2023-08-23 19:08 sfernandez Status assigned => resolved
2023-08-23 19:08 sfernandez Resolution open => fixed
2023-08-23 19:08 sfernandez Note Added: 0008663
2023-08-23 19:09 sfernandez Fixed in Version => 3.2.2