Is is possible to use variable in generic >> EventCallback.Factory.Create<VarType>()
i try this but error
Type dynamicType = typeof(Byte); // string, int, datetime
EventCallback.Factory.Create<dynamicType >(); // error
2 Replies
No, generics are compile-time only
(however in this example there's not really a reason to use a variable for the type)
Can you show a piece of your actual code where you want this?
editor.AddAttribute(j++, "ValueChanged", EventCallback.Factory.Create<Byte>(this, str => property.SetValue(Data, str)));
I want to make dynamic form. Data can be int, decimal, byte, ...