AnimatedTabControl.Wpf in StockTraderRI

Topics: Prism v2 - WPF 4, Prism v4 - WPF 4
Aug 20, 2010 at 10:01 AM

The WPF reference implementation StockTraderRI uses a nice animated tab control (AnimatedTabControl). I would like to use it in my application, but there is one annoying issue: The first time I click a tab after application initialization it won't react or the animation effect looks really bad. I assume this is related to late loading of modules/views. Does anyone have a solution to this?

Sep 13, 2010 at 7:36 PM

Are you using a recent drop?  There was a bug fix in the animated tab control a while back for either Prism v2.2 or the initial work on Prism v4 that may help.  If not, let me know and we can investigate a bit.

 

Sep 14, 2010 at 11:52 AM

Thank you for the response. I've testet a little bit, and it seems that the bug is fixed. It works fine in the current drop (v4 drop 7).

Sep 14, 2010 at 2:47 PM

That is good to hear.

Thanks for reporting the problem.

Sep 20, 2010 at 12:46 PM

For information only.

It seems that the only change since v2.2 is a skipped if check in AnimatedTabControl.Desktop.cs --> OnSelectionChanged.

If you compile v.2.2 with this change, the tab control seems to work fine:

...

protected override void OnSelectionChanged(SelectionChangedEventArgs e)
        {
           // if (e.RemovedItems.Count > 0)
           // {
                this.RaiseSelectionChangingEvent();

                this.StopTimer();
                this.lastArgs = e;

                this.timer = new DispatcherTimer
                {
                    Interval = new TimeSpan(0, 0, 0, 0, 500)
                };

                this.timer.Tick += this.Timer_Tick;
                this.timer.Start();
           // }
        }

...