Need help reading a date value inside DataContext in wpf. (scsm,.net)

I have a date field that is in the datacontext coming from scsm and am trying to access its value and don't know how.

I am attempting to access it from a .net wpf user control do some processing and update a label value on the same scsm form.

Here is a screenshot of what Im seeing when I attach with the debugger in visual studio to the scsm form.

The field Im trying to access is from a datepicker named ReceivedDate.  I am hitting a breakpoint in the code below and inspecting what is in datacontext.  Im trying to pass the date value to another method to do some calculations.  Im just trying to figure out how to access the contents of the ReceivedDate value inside the datacontext.

    private void FormControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
            if (this.DataContext != null && this.DataContext is IDataItem)
            {                //Do not add validation if in template mode                
                if (!FormUtilities.Instance.IsFormInTemplateMode(this)) ProcessControls();

DataContext object
Steve HougomDeveloper IIAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The *Key* here (no pun intended) is the type of object that is in the DataContext propertyCache.

The type of the item in question is a KeyValuePair, so the Value property will contain the Date.Capture.JPG

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve HougomDeveloper IIAuthor Commented:
Yep this code does it.

IDataItem item = this.DataContext as IDataItem;
DateTime RecDate = (DateTime)item["ReceivedDate"];

Based on this nice article here.
Steve HougomDeveloper IIAuthor Commented:
Thanks for the tip.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.