Custom ExtensionMethods.GetNamedElementsInScope

Oct 1, 2010 at 11:19 AM

Hi,

Its apparent it need to write my own implementation of ExtensionMethods.GetNamedElementsInScope. With not being accomplished with all the newer functionality of C# I'm not sure where or how to override the default implementation without modify Caliburn Micro itself? Can anyone assist... I've also look at Caliburn v2 and had the same issue..

Oct 1, 2010 at 1:20 PM

In your bootstrapper, you have to assing a new delegate in the ExtensionMethods.GetNamedElementsInScope field:

ExtensionMethods.GetNamedElementsInScope = elementInScope => {

    //your logic here
    IEnumerable<FrameworkElement> result = ...

    return result;
}

which is equivalent to

private IEnumerable<FrameworkElement> GetNamedElementsInScopeImplementation(DependencyObject elementInScope) {

    //your logic here
    IEnumerable<FrameworkElement> result = ...

    return result;
}
...
ExtensionMethods.GetNamedElementsInScope = GetNamedElementsInScopeImplementation;


 

Oct 1, 2010 at 3:38 PM

Thanks for that!!