private object CreatePrismInstance()
        {
            if (this.IsInDesignMode())
            {
                var designTimeBlankContainer = new Grid
                {
                    Background = new SolidColorBrush(Color.FromArgb(50, 120, 120, 120)),
                };
                if (_prismDataTemplate.DesignWidth.HasValue) designTimeBlankContainer.Width = _prismDataTemplate.DesignWidth.Value;
                if (_prismDataTemplate.DesignHeight.HasValue) designTimeBlankContainer.Height = _prismDataTemplate.DesignHeight.Value;

                var formatText = string.Format("Prism template: {0}", _prismDataTemplate.ServiceType.Name);
                if (!string.IsNullOrEmpty(_prismDataTemplate.Key)) formatText += string.Format(", {0}", _prismDataTemplate.Key);
                designTimeBlankContainer.Children.Add(new TextBlock
                {
                    Text = formatText,
                    VerticalAlignment = VerticalAlignment.Center,
                    HorizontalAlignment = HorizontalAlignment.Center,
                });

                return designTimeBlankContainer;
            }

            var view = ServiceLocator.Current.GetInstance(_prismDataTemplate.ServiceType, _prismDataTemplate.Key) as FrameworkElement;
            if (view == null)
            {
                var error = string.Format("Service type {0} with {1} key object must be inherited from FrameworkElement",
                                          _prismDataTemplate.ServiceType,
                                          _prismDataTemplate.Key);
                throw new ArgumentException(error);
            }
            var container = new ContentPresenter
            {
                Content = view
            };
            container.AddHandler(FrameworkElement.LoadedEvent, new RoutedEventHandler(LoadedRoutedEventHandler));
            container.AddHandler(FrameworkElement.UnloadedEvent, new RoutedEventHandler(UnloadedRoutedEventHandler));

            return container;
        }