Hi,
I have bound to a TreeListView a collection of instances that raise the PropertyChanged from a thread that is not the main UI thread (the event is raised from a FileSystemWatcher event). When PropertyChanged is risen I meet the following exception:
InvalidOperationException was unhandled: The calling thread cannot access this object because a different thread owns it.
en System.Windows.Threading.Dispatcher.VerifyAccess()
en System.Windows.DependencyObject.GetValue(DependencyProperty dp)
en Telerik.Windows.Controls.RadRowItem.get_Item() en c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\RadRowItem.cs:línea 30
en Telerik.Windows.Controls.GridView.GridViewRow.BeginProcessDataItemPropertyChanged(Object dataItem, String propertyName) en c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:línea 2201
en Telerik.Windows.Controls.GridView.GridViewRow.Telerik.Windows.Data.IWeakEventListener<System.ComponentModel.PropertyChangedEventArgs>.ReceiveWeakEvent(Object sender, PropertyChangedEventArgs args) en c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:línea 2196
en Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) en c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:línea 33
en System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
en RadControlsWpfApp1.NodoFile.OnPropertyChanged(String propiedad) en g:\Users\Ruben\Mis documentos\Visual Studio 2012\Projects\RadControlsWpfApp1\RadControlsWpfApp1\NodoFile.cs:línea 66
en RadControlsWpfApp1.NodoFile.set_Nombre(String value) en g:\Users\Ruben\Mis documentos\Visual Studio 2012\Projects\RadControlsWpfApp1\RadControlsWpfApp1\NodoFile.cs:línea 42
en RadControlsWpfApp1.NodoFile._watch_Renamed(Object sender, RenamedEventArgs e) en g:\Users\Ruben\Mis documentos\Visual Studio 2012\Projects\RadControlsWpfApp1\RadControlsWpfApp1\NodoFile.cs:línea 48
en System.IO.FileSystemWatcher.OnRenamed(RenamedEventArgs e)
en System.IO.FileSystemWatcher.NotifyRenameEventArgs(WatcherChangeTypes action, String name, String oldName)
en System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
en System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
It really surprised me because I've previously bound other telerik WPF controls in an analogue situation and they worked flawlessly. Having a peek on GridViewRow.BeginProcessDataItemProperty I've noticed that it makes a call through the Dispatcher (which should avoid the exception) but the call to retrieve the dataItem for the row is outside the Dispatcher.BeginInvoke and that's (I pressume) the cause of the exception.
I don't know if this is intended behaviour or just a little bug but any feedback would be greatly appreciated.
Thanks in advance.
I have bound to a TreeListView a collection of instances that raise the PropertyChanged from a thread that is not the main UI thread (the event is raised from a FileSystemWatcher event). When PropertyChanged is risen I meet the following exception:
InvalidOperationException was unhandled: The calling thread cannot access this object because a different thread owns it.
en System.Windows.Threading.Dispatcher.VerifyAccess()
en System.Windows.DependencyObject.GetValue(DependencyProperty dp)
en Telerik.Windows.Controls.RadRowItem.get_Item() en c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\RadRowItem.cs:línea 30
en Telerik.Windows.Controls.GridView.GridViewRow.BeginProcessDataItemPropertyChanged(Object dataItem, String propertyName) en c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:línea 2201
en Telerik.Windows.Controls.GridView.GridViewRow.Telerik.Windows.Data.IWeakEventListener<System.ComponentModel.PropertyChangedEventArgs>.ReceiveWeakEvent(Object sender, PropertyChangedEventArgs args) en c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Rows\GridViewRow.cs:línea 2196
en Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) en c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:línea 33
en System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
en RadControlsWpfApp1.NodoFile.OnPropertyChanged(String propiedad) en g:\Users\Ruben\Mis documentos\Visual Studio 2012\Projects\RadControlsWpfApp1\RadControlsWpfApp1\NodoFile.cs:línea 66
en RadControlsWpfApp1.NodoFile.set_Nombre(String value) en g:\Users\Ruben\Mis documentos\Visual Studio 2012\Projects\RadControlsWpfApp1\RadControlsWpfApp1\NodoFile.cs:línea 42
en RadControlsWpfApp1.NodoFile._watch_Renamed(Object sender, RenamedEventArgs e) en g:\Users\Ruben\Mis documentos\Visual Studio 2012\Projects\RadControlsWpfApp1\RadControlsWpfApp1\NodoFile.cs:línea 48
en System.IO.FileSystemWatcher.OnRenamed(RenamedEventArgs e)
en System.IO.FileSystemWatcher.NotifyRenameEventArgs(WatcherChangeTypes action, String name, String oldName)
en System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
en System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
It really surprised me because I've previously bound other telerik WPF controls in an analogue situation and they worked flawlessly. Having a peek on GridViewRow.BeginProcessDataItemProperty I've noticed that it makes a call through the Dispatcher (which should avoid the exception) but the call to retrieve the dataItem for the row is outside the Dispatcher.BeginInvoke and that's (I pressume) the cause of the exception.
I don't know if this is intended behaviour or just a little bug but any feedback would be greatly appreciated.
Thanks in advance.