In Wpf ListView can have several "view classes" to show items.
Those classes derived from "BaseView" class.
When you create custom views, you can't create RoutedEvents because "BaseView" has not a "AddHandle" static method.
I had created a GridViewSort view. (With column sorting feature) and I want to add a "DoSort" routed event with column and sortdirection as parameters.
BUT when I try to use AddHandler and DeleteHandler. Those methods are not available into "baseview" class.
Can I provide an alternative to those methods?
What I have tried:
public class GridViewSort:GridView
{
private static readonly string SortUpIcon = "M 2,5 L 4,3 L 6,5 L 2,5";
private static readonly string SortDownIcon = "M 2,3 L 4,5 L 6,3 L 2,3";
public static readonly RoutedEvent DoSortEvent = EventManager.RegisterRoutedEvent("DoSort",
RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(GridViewSort));
public event RoutedEventHandler DoSort
{
add { AddHandler(DoSortEvent, value); }
remove { RemoveHandler(DoSortEvent, value); }
}