Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TryClose throws Ambiguous match found #605

Closed
Craigoss opened this issue May 22, 2019 · 2 comments
Closed

TryClose throws Ambiguous match found #605

Craigoss opened this issue May 22, 2019 · 2 comments
Labels
Milestone

Comments

@Craigoss
Copy link

Hello,

We are using version 3.2.0 inconjuction with DevExpress Wpf controls. When we call TryClose from a Screen it throws a "Ambiguous match found" exception. Stack trace below:

Ambiguous match found.
at System.RuntimeType.GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConv, Type[] types, ParameterModifier[] modifiers)
at System.Type.GetMethod(String name)
at Caliburn.Micro.XamlPlatformProvider.GetViewCloseAction(Object viewModel, ICollection1 views, Nullable1 dialogResult)
at Caliburn.Micro.Screen.TryClose(Nullable`1 dialogResult)

It looks like the issue is in the XamlPlatformProvider.cs in the method GetViewCloseAction. Caliburn micro does a GetMethod("Close"), however DevExpress ThemedWindow has an overloaded Close method aswell as the base Window class. Would it be possible to change this GetMethod() line of code to return GetMethods("Close") and choose the method with no parameters?

Would greatly appreciate an update.

Thanks.

@nigel-sampson nigel-sampson added this to the v4.0.0 milestone May 22, 2019
@nigel-sampson
Copy link
Contributor

This is definitely something I can add. I doubt I'll do a 3.3 release for it though.

If you're looking for a quicker fix you can inherit from XamlPlatformProvider and override GetViewCloseAction with the change in it.

@Craigoss
Copy link
Author

Thanks for the feedback, I have been able to override the class to get it working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants