2

Commonly known, ObjectDataProvider can invoke simple nongeneric methods like that

XAML:

<ObjectDataProvider x:Key="SimpleKey" MethodName="Nongeneric" ObjectType="{x:Type local:SomeClass}">
</ObjectDataProvider>

CodeBehind:

public static SomeClass
{
    public static void NongenericMethod()
    {
        // method body        
    }

    public static void GenericMethod<T>()
    {
        // method body
    }
}

Is it possible that ObjectDataProvider invokes generic method? Something like that:

<ObjectDataProvider x:Key="SimpleKey" MethodName="GenericMethod<local:OtherClass>" ObjectType="{x:Type local:SomeClass}">
</ObjectDataProvider>
monstr
  • 1,680
  • 1
  • 25
  • 44
  • 1
    Generics are not supported in XAML. You can check out workaround for it here - http://stackoverflow.com/questions/7152196/how-use-listt-within-xaml. – Rohit Vats May 28 '14 at 07:38
  • Possible duplicate of [how use List within xaml?](https://stackoverflow.com/questions/7152196/how-use-listt-within-xaml) – JoshuaTheMiller Jun 21 '17 at 01:51

0 Answers0