Project Description
A collaboration framework for occasionally connected smart clients and web applications. Store data on the device, push it to the server, and synchronize with other devices. Give your users a customized native application, or gracefully degrade to HTML on other devices.

Download using NuGet

Add the Correspondence AllInOne package that's right for your application:
  • Silverlight - Correspondence.Silverlight.AllInOne
  • Windows Phone - Correspondence.WindowsPhone.AllInOne
  • WPF - Correspondence.Desktop.AllInOne
  • MVC 3 - Correspondence.Web.AllInOne

See the Readme.txt file for additional instructions.

After learning your way around, try the testable version.
  • Model Create a class library and add Correspondence.Model
  • ViewModel Create another class library and add Correspondence. Add a reference to Model.
  • UnitTest Create a Silverlight or Windows Phone application, or a Desktop or Web unit test project. Add Correspondence.*.UnitTest. Add a reference to both Model and ViewModel.
  • Application Create an application and add Correspondence.*.App. Add a reference to both Model and ViewModel.

Step 1: define a fact
You express your model in a language called Factual. A fact looks like this:
fact Message {
key:
    Conversation conversation;
    User sender;

    string body;
}


Step 2: add a fact to the community
Adding a fact stores it in the local database and publishes it for other peers.
public partial class Conversation
{
    public void SendMessage(User sender, string body)
    {
        Community.AddFact(new Message(this, sender, body));
    }
}

Step 3: query for related facts
A query is expressed in Factual as part of a fact. The colon (:) is pronounced "such that", as in "messages is the set of Message facts m such that m.conversation is this Conversation".
fact Conversation {
    // ...

query:
    Message *messages {
        Message m : m.conversation = this
    }
}


Step 4: access query results
Query results appear as an enumerable property of the fact. The results are bindable, even through a view model:
public class ConversationViewModel
{
    private Conversation _conversation;

    public ConversationViewModel(Conversation conversation)
    {
        _conversation = conversation;
    }

    public IEnumerable<string> Messages
    {
        get
        {
            return _conversation.Messages
                .Select(m => string.Format("{0}: {1}",
                    m.Sender.UserName,
                    m.Body));
        }
    }
}

Lesson 1a: Identity
Lesson 1b: Unique
Lesson 1c: Predecessors
Lesson 1d: Successors
Practice 1: Define a query

Lesson 2a: Partial classes
Lesson 2b: View model
Lesson 2c: Command activation
Lesson 2d: Data binding
Practice 2: Create a view model
Practice 2: Data bind thew new view model

Lesson 3a: Negative facts
Lesson 3b: Negative command in the view model
Lesson 3c: Enable and disable the negative command
Lesson 3d: Data bind the negative command
Practice 3: Create a negative fact

Lesson 4a: Publish subscribe
Lesson 4b: Correspondence Server
Practice 4: Subscribe to games

Last edited Dec 1, 2011 at 3:02 AM by MichaelLPerry1971, version 29