Search This Blog

Saturday, October 31, 2015

Setting up SQLite and EF6

Here is something that is more difficult than it should be.

My answer on StackOverflow:

My environment:

VS2013 Pro
Entity Framework 6: version 6.1.3
Sqlite .net library: System.Data.SQLite versions: 1.093 - 1.095

Do not use Nuget Manager to download 



Monday, October 26, 2015

How to efficently update WPF MainWindow from an async task

Is this an acceptable approach to update WPF MainWindow from an async task, using events thrown from a public static class?
In MainWindow.cs, I subscribe to UI.TaskCompleted event In UI.cs, I subscribe to AsyncTaskActions.TaskCompleted event.
Using this pattern, AsyncTaskActions.TaskCompleted is raised with a async task is completed. UI catch the event and raise UI.TaskCompleted. This way, the event is catch in MainWindow code where I can use Displacher.Invoke to refresh the displayed page. The end result is I get a page refresh when a task is completed and the task still runs asychronously.
Application design summary:
MainWindow: main window which can have several different page classes in content area within the main window.
Common.cs public static class contains a number of common methods through the UI in the application.
AsyncTaskActions.cs - class with a number of async common methods (ie download file)