private void ValidateNewDefinition(object sender, ConditionalEventArgs e)
        {
            Pair <string, Type>     metaDataPair           = this.GetBinding <Pair <string, Type> >("SelectedMetaDataDefinition");
            IPageMetaDataDefinition pageMetaDataDefinition = PageMetaDataFacade.GetMetaDataDefinition(GetCurrentPageId(), metaDataPair.First);

            e.Result = true;

            string newLabel = this.GetBinding <string>("Label");
            Guid   newMetaDataContainerId = this.GetBinding <Guid>("SelectedMetaDataContainer");

            Guid pageId = GetCurrentPageId();

            if (pageMetaDataDefinition.Label != newLabel)
            {
                if (PageMetaDataFacade.IsDefinitionAllowed(pageId, pageMetaDataDefinition.Name, newLabel, pageMetaDataDefinition.MetaDataTypeId) == false)
                {
                    e.Result = false;
                    ShowFieldMessage("Label", StringResourceSystemFacade.GetString("Composite.Management", "AssociatedDataElementProviderHelper.EditMetaDataWorkflow.MetaDataFieldNameAlreadyUsed"));
                }
            }

            if (pageMetaDataDefinition.MetaDataContainerId != newMetaDataContainerId)
            {
                if (PageMetaDataFacade.IsNewContainerIdAllowed(pageId, pageMetaDataDefinition.Name, newMetaDataContainerId) == false)
                {
                    e.Result = false;
                    ShowFieldMessage("SelectedMetaDataContainer", StringResourceSystemFacade.GetString("Composite.Management", "AssociatedDataElementProviderHelper.EditMetaDataWorkflow.MetaDataContainerChangeNotAllowed"));
                }
            }
        }
        private void ValidateBindings(object sender, ConditionalEventArgs e)
        {
            IPageTypeMetaDataTypeLink pageTypeMetaDataTypeLink = this.GetDataItemFromEntityToken <IPageTypeMetaDataTypeLink>();

            IPageMetaDataDefinition pageMetaDataDefinition = PageMetaDataFacade.GetMetaDataDefinition(pageTypeMetaDataTypeLink.PageTypeId, pageTypeMetaDataTypeLink.Name);

            string metaDataDescriptionLabel = this.GetBinding <string>("CompositionDescriptionLabel");
            Guid   containerId = this.GetBinding <Guid>("CompositionContainerId");

            e.Result = true;

            if (pageMetaDataDefinition.Label != metaDataDescriptionLabel)
            {
                if (PageMetaDataFacade.IsDefinitionAllowed(pageTypeMetaDataTypeLink.PageTypeId, pageMetaDataDefinition.Name, metaDataDescriptionLabel, pageMetaDataDefinition.MetaDataTypeId) == false)
                {
                    this.ShowFieldMessage("CompositionDescriptionLabel", GetText("PageType.EditPageTypeMetaDataFieldWorkflow.ValidationError.MetaDataFieldNameAlreadyUsed"));
                    SetSaveStatus(false);
                    e.Result = false;
                }
            }

            if (pageMetaDataDefinition.MetaDataContainerId != containerId)
            {
                if (PageMetaDataFacade.IsNewContainerIdAllowed(pageTypeMetaDataTypeLink.PageTypeId, pageMetaDataDefinition.Name, containerId) == false)
                {
                    this.ShowFieldMessage("CompositionContainerId", GetText("PageType.EditPageTypeMetaDataFieldWorkflow.ValidationError.MetaDataContainerChangeNotAllowed"));
                    SetSaveStatus(false);
                    e.Result = false;
                }
            }
        }