I am doing a Windows Phone 7 application, it uses a calender control from namespace System.Windows.Controls
. My calender control is placed inside the TabControl from the same namespace.
When I select a date am getting following "NotSupportedException" message saying :
"This type of Collection does not support changes to its SourceCollection from a thread different from the Dispatcher thread."
What could be the reason for this type of error and could i have a solution for this?
Exception details : System.NotSupportedException was unhandled Message=This type of Collection does not support changes to its SourceCollection from a thread different from the Dispatcher thread. StackTrace: at System.Windows.Controls.SelectedDatesCollection.InsertItem(Int32 index, DateTime item) at System.Collections.ObjectModel.Collection`1.Add(DateTime item) at System.Windows.Controls.SelectedDatesCollection.AddRange(DateTime start, DateTime end) at System.Windows.Controls.Primitives.CalendarItem.AddSelection(CalendarDayButton b) at System.Windows.Controls.Primitives.CalendarItem.Cell_MouseLeftButtonUp(Object sender, MouseButtonEventArgs e) at System.Windows.Controls.Primitives.CalendarDayButton.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)