How to apply animation on ListBoxItem before removal?

Emon Haque 3,176 Reputation points
2020-10-25T11:52:49.217+00:00

I've a Custom Control EditListBox:

public class EditListBox : ListBox
{
    static EditListBox()
    {
        DefaultStyleKeyProperty.OverrideMetadata(typeof(EditListBox), new FrameworkPropertyMetadata(typeof(EditListBox)));
    }
    protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e) 
    {
        switch (e.Action)
        {
            case NotifyCollectionChangedAction.Remove:
                var removedItem = e.OldItems[0];
                break;
        }
    }
}

and in Remove action I get the Removed Item. How to apply a ColorAnimation there on the removed item?

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,783 questions
{count} votes

Accepted answer
  1. gekka 9,586 Reputation points MVP
    2020-10-31T13:01:19.807+00:00

    I put an answer code for this question to gist ,because posting it will be an error in the QnA system.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.