public static bool IsTypeCompatible(SceneNode sceneNode, IType typeToInsert, IProperty property)
        {
            if (typeToInsert.RuntimeType == (Type)null || !sceneNode.ProjectContext.PlatformMetadata.IsSupported((ITypeResolver)sceneNode.ProjectContext, (ITypeId)typeToInsert) || PlatformTypes.UserControl.IsAssignableFrom((ITypeId)sceneNode.Type) && PropertySceneInsertionPoint.ContentProperty.Equals((object)property) && sceneNode.ViewModel.RootNode != sceneNode || (PlatformTypes.Window.IsAssignableFrom((ITypeId)typeToInsert) || PlatformTypes.Page.IsAssignableFrom((ITypeId)typeToInsert) || !property.TargetType.IsAssignableFrom(sceneNode.TargetType) || PlatformTypes.IsEffectType((ITypeId)typeToInsert) && property.PropertyType.Equals((object)PlatformTypes.Object)))
            {
                return(false);
            }
            if (property.PropertyType.IsAssignableFrom((ITypeId)typeToInsert))
            {
                return(true);
            }
            if (!sceneNode.ProjectContext.IsCapabilitySet(PlatformCapability.SupportsAutoTabItemWrapping) && ProjectNeutralTypes.TabControl.IsAssignableFrom((ITypeId)sceneNode.TrueTargetTypeId) && (PlatformTypes.FrameworkElement.IsAssignableFrom((ITypeId)typeToInsert) && !ProjectNeutralTypes.TabItem.IsAssignableFrom((ITypeId)typeToInsert)))
            {
                return(false);
            }
            if (property.Equals((object)BehaviorHelper.BehaviorsProperty) && ProjectNeutralTypes.Behavior.IsAssignableFrom((ITypeId)typeToInsert) || property.Equals((object)BehaviorHelper.BehaviorTriggersProperty) && (ProjectNeutralTypes.BehaviorTriggerAction.IsAssignableFrom((ITypeId)typeToInsert) || ProjectNeutralTypes.BehaviorTriggerBase.IsAssignableFrom((ITypeId)typeToInsert)))
            {
                return(BehaviorHelper.IsSceneNodeValidHost(sceneNode, typeToInsert));
            }
            Type genericCollectionType = CollectionAdapterDescription.GetGenericCollectionType(PlatformTypeHelper.GetPropertyType(property));

            return(genericCollectionType != (Type)null && sceneNode.ProjectContext.GetType(genericCollectionType).IsAssignableFrom((ITypeId)typeToInsert) || PlatformTypes.UIElementCollection.Equals((object)property.PropertyType) && PlatformTypes.UIElement.IsAssignableFrom((ITypeId)typeToInsert) || (PlatformTypes.FlowDocument.IsAssignableFrom((ITypeId)property.PropertyType) || PlatformTypes.InlineCollection.IsAssignableFrom((ITypeId)property.PropertyType) || PlatformTypes.BlockCollection.IsAssignableFrom((ITypeId)property.PropertyType)) && (PlatformTypes.UIElement.IsAssignableFrom((ITypeId)typeToInsert) && (bool)sceneNode.ViewModel.ProjectContext.GetCapabilityValue(PlatformCapability.SupportsInlineUIContainer)) || (PlatformTypes.ItemCollection.Equals((object)property.PropertyType) || ItemsControlElement.ItemsProperty.Equals((object)property)));
        }