Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am creating a custom blend behavior to act on ListboxItem i.e.

C#
public class DragtestBehaviour : Behavior<ListBoxItem>
{
    public DragtestBehaviour()
    { // Insert code required on object creation below this point.
    }
    protected override void OnAttached()
    {
        base.OnAttached();
        // Insert code that you would want run when the Behavior is attached to an object.
    }
    protected override void OnDetaching()
    {
        base.OnDetaching();
        // Insert code that you would want run when the Behavior is removed from an object.
    }
}

What I am not able to figure out is how do I attach it to listboxitem.
Alternatively do I have to style the Listbox item and attach it to Border or any other element in style. If this is true than I have to also derive my behavior class from Border (i.e. Framework element).
C#
DragtestBehaviour : Behavior<Frameworkelement>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900