You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI,
in the pr AvaloniaUI/Avalonia#15274. I have need to retrieve Interactive.AddHandler<TEventArgs> method. To do this, I tried using IXamlType.FindMethod and checking if the method name is AddHandler`1 without success.
AddHandlerT=Interactive.FindMethod(m =>m.IsPublic&&!m.IsStatic&&m.Name=="AddHandler"&&m.Parameters.Count==4&&RoutedEvent.IsAssignableFrom(m.Parameters[0])&&m.Parameters[0].GenericArguments?.Count==1// This is specific this case workaround to check is generici method&&(cfg.WellKnownTypes.Delegate).IsAssignableFrom(m.Parameters[1])&&m.Parameters[2].IsEnum&&m.Parameters[3].Equals(cfg.WellKnownTypes.Boolean)==true
I would like to make a PR that makes it easier to identify the generic method. There are a few possibilities:
Add `n to the end of name of generic method, where n is number of generic arguments
Add property IsGenericDef to IXamlMethod
Expose GenericArguments and GenericParameters
All three previous proposed solutions
What do you think is the best solution?
The text was updated successfully, but these errors were encountered:
HI,
in the pr AvaloniaUI/Avalonia#15274. I have need to retrieve
Interactive.AddHandler<TEventArgs>
method. To do this, I tried usingIXamlType.FindMethod
and checking if the method name is AddHandler`1 without success.After investigation I found following workaround
https://github.com/AvaloniaUI/Avalonia/blob/3f82e64c469198d3e80557b7c3c5071a8c29d806/src/Markup/Avalonia.Markup.Xaml.Loader/CompilerExtensions/Transformers/AvaloniaXamlIlWellKnownTypes.cs#L155-L163
I would like to make a PR that makes it easier to identify the generic method. There are a few possibilities:
IsGenericDef
to IXamlMethodWhat do you think is the best solution?
The text was updated successfully, but these errors were encountered: