/// <summary>
        /// Initializes a new instance of the <see cref="CompositionServiceBindingContext"/> class.
        /// </summary>
        public CompositionServiceBindingContext(INuPatternCompositionService compositionService)
        {
            try
            {
                // TODO: This should work as per suggestion BlueTab-PLATU10.
                this.SetupContainer(compositionService.GetExportedValue <ExportProvider>());

                return;
            }
            catch (ImportCardinalityMismatchException)
            {
                // TODO: \o/ when BlueTab-PLATU10 is fixed, this workaround should be removed.
                // Note: we don't go straight for this behavior because otherwise anything that uses dynamic
                // bindings would become untestable automatically.
                var defaultImplementation = compositionService as NuPatternCompositionService;
                if (defaultImplementation != null)
                {
                    var containerField = typeof(NuPatternCompositionService).GetField("container", BindingFlags.Instance | BindingFlags.NonPublic);
                    if (containerField == null)
                    {
                        throw new NotSupportedException(Resources.BindingFactory_DefaultCompositionServiceChanged);
                    }

                    var compositionContainer = containerField.GetValue(defaultImplementation) as CompositionContainer;
                    if (compositionContainer == null)
                    {
                        throw new NotSupportedException(Resources.BindingFactory_DefaultCompositionServiceContainerUnavailable);
                    }

                    this.SetupContainer(compositionContainer);

                    return;
                }
            }

            throw new NotSupportedException(Resources.BindingFactory_DynamicContextUnsupported);
        }