views:

6

answers:

0

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.