I have a problem with thread.When I want set a GridView into a ListView as View in another thread.It display a message which said:
Must create DependencySource on same Thread as the DependencyObject.
// Create grid view
GridView grid = new GridView();
// Add column
// Name
grid.Columns.Add((GridViewColumn)myresourcedictionary["gridDirFileName"]);
// Type
grid.Columns.Add((GridViewColumn)myresourcedictionary["gridDirFileType"]);
// Data Modified
grid.Columns.Add((GridViewColumn)myresourcedictionary["gridDirFileDataModified"]);
// Size
grid.Columns.Add((GridViewColumn)myresourcedictionary["gridDirFileSize"]);
// Edit view
Application.Current.Dispatcher.Invoke(new Action(() => ListViewOp.View = grid));
What am I doing?