public override object TearDown(IBuilderContext context, object item)
        {
            FrameworkElement frameworkElement = item as FrameworkElement;

            if ((frameworkElement != null) && (frameworkElement is IActionProvider))
            {
                WorkItem workItem = context.Locator.Get <WorkItem>(new DependencyResolutionLocatorKey(typeof(WorkItem), null));

                IActionActivationService service = workItem.Services.Get <IActionActivationService>(false);

                if (service != null)
                {
                    service.FrameworkElementRemoved(frameworkElement);
                }
            }

            return(base.TearDown(context, item));
        }
        public override object BuildUp(IBuilderContext context, Type typeToBuild, object existing, string idToBuild)
        {
            FrameworkElement frameworkElement = existing as FrameworkElement;

            if ((frameworkElement != null) && (frameworkElement is IActionProvider))
            {
                WorkItem workItem = context.Locator.Get <WorkItem>(new DependencyResolutionLocatorKey(typeof(WorkItem), null));

                IActionActivationService service = workItem.Services.Get <IActionActivationService>(false);

                if (service != null)
                {
                    service.FrameworkElementAdded(frameworkElement);
                }
            }

            return(base.BuildUp(context, typeToBuild, existing, idToBuild));
        }