문제

I am looking to be able to validate if user is looking to make a valid drag drop and have this indicated by the colour of the destination CompartmentShape, I have done the following which gives me the ability to validate correctly, I just need to update the UI

    public override void OnDragDrop(DslDiagrams.DiagramDragEventArgs e)
    {
        BCSDataSourceTypes dataSourceType = GetDataSourceType(e.Data);

        if (dataSourceType == BCSDataSourceTypes.Unknown)
        {
            return;
        }

        FieldInfo info = e.Data.GetType().GetField("innerData", BindingFlags.NonPublic | BindingFlags.Instance);
        object obj = info.GetValue(e.Data);
        info = obj.GetType().GetField("innerData", BindingFlags.NonPublic | BindingFlags.Instance);
        System.Windows.DataObject dataObj = info.GetValue(obj) as System.Windows.DataObject;

        if (dataObj != null)
        {
            SqlStoredProcedure storedProcedure = dataObj.GetData(typeof(SqlStoredProcedure)) as SqlStoredProcedure;
            if (storedProcedure != null)
            {
                MessageBox.Show(string.Format("{0} is valid here", storedProcedure.Name));
            }
        }

        e.Handled = true;
    }

My issue is that I am not able to get any reference to the Outline colour, any help is greatly appreciated.

도움이 되었습니까?

해결책

You need to add an exposed property (right click on the shape and choose "Add Exposed")

Best regards

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top