WordPress database error: [INSERT, UPDATE command denied to user '51213-2'@'10.10.20.149' for table 'wp_options']INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1715240625.7453680038452148437500', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
<\/a>Here is the seventh (OMG !) post on the WPF 4.5 new features<\/a>. Collections are a part of every<\/span> application and their management is maybe the first thing you learn to deal with in WPF.<\/p>\n To begin, you put everything on the main(the UI one) thread and it works just fine. After a few time, you realize that it freezes the application UI and that the users usually don’t like it. Then you put the collections creation\/feeding on another Thread to free the UI’s one and you realize that it is not possible because<\/strong> : “This type of CollectionView does not support changes to its SourceCollection from a thread different from the Dispatcher thread”.<\/em><\/p>\n In this post we will discover that this is over with WPF 4.5 (and that you’ll love it) !<\/p>\n <\/p>\n Let’s say that you have an application which display peoples on a list. The loading of the full list is quite long because it requires to go to a database via a WCF services and then to come back with the information.<\/p>\n In WPF 4.0 you have two different solutions:<\/span><\/p>\n Here is a an example of this second solution:<\/p>\n [csharp] public List RetrieveTheCollection()How do we do in WPF 4.0 ?<\/h3>\n
\n
\n private void LoadUpPersonsClick(object sender, RoutedEventArgs e)
\n {
\n Task.Factory
\n \/\/Retrieve the persons on another thread.
\n .StartNew>(RetrieveTheCollection)
\n .ContinueWith(t =>
\n {
\n foreach (var p in t.Result) _persons.Add(p);
\n },
\n \/\/Continue on the UI Thread
\n TaskScheduler.FromCurrentSynchronizationContext());
\n }<\/p>\n
\n {
\n List persons = new List();
\n for (int i = 0; i < 10; i++)
\n {
\n persons.Add(new Person() { Name = "Person " + i, Age = 40 + i % 5 });
\n }
\n return persons;
\n }
\n[\/csharp]<\/p>\nHow do we do in WPF 4.5 ?<\/h3>\n