TextChanged event firing due to UI Virtualization?

2 posts, 0 answers
  1. Greg
    Greg avatar
    3 posts
    Member since:
    Jan 2012

    Posted 26 Jan 2012 Link to this post

    I have a Usercontrol that I use as my cell's DataTemplate (actually I stick it directly into my controltemplate, but shouldn't make a difference)

    I have a DependencyProperty that is bound to the Value of the cell, and the changed-listener looks like this

    public static void TextChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
            {
                double dub;
                if (e.OldValue != null && e.NewValue != null && (e.NewValue is double || (e.NewValue is string && double.TryParse(e.NewValue.ToString(), out dub))))
                {  
                    var control = o as ValueCellPresenter;
     
                    if (control.IsLoaded)
                    {
                        ((Storyboard)control.Resources["CellFlash"]).Begin();
                    }
     
                }
                 
            }

    however, this animation fires when I am scrolling, because of UI virtualization.

    I use this animation to flash the cell when the value changes.  Is there a better way to do this to avoid getting the animation fired when UI virtualization is in effect?  When I turn the virtualization off the problem goes away.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 01 Feb 2012 Link to this post

    Hello,

     Unfortunately we are not aware of any other approach for this.

    Regards,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top