This project is read-only.

Getting Started

  1. Download the source code either as ZIP or for the more adventurous grab the latest build from source repository.
  2. Open MobileUI solution in Visual Studio 2008 (make sure that you have Windows Mobile 5 or 6 SDK installed first).
  3. Set the Demo project as the Startup.
  4. Run using an enumlator or device (Windows Mobile 5.0 PocketPC or SmartPhone or Windows Mobile 6.0 Standard or Professional).

Writing your own application using the MobileUI Framework

  1. Create a new Smart Device project targetting Windows Mobile 5.0 or 6.0.
  2. Add references to the Spencen.Mobile.Markup and Spencen.Mobile.UI assemblies (given this is still in Beta I'd recommend you add these projects to your solution so you can debug if required rather than using file references).
  3. Add the Spencen.Mobile.UI assembly to the Toolbar - specifically the Canvas control.
  4. Drag this control onto your form - it should dock to fill the available space but without obscuring menu or title bar.
  5. In the forms constructor (after InitializeComponent) create a new View either programmatically or via the XamlReader (see below) and then assign this to the Canvas's View property.
 public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

            Canvas1.View = CreateMyView();
        }
    }

Tidying things up a bit

Rather than creating a view and just assigning it to the canvas for display we will extend on this by creating a Presenter class and use the built in navigation helpers to allow us to move through multiple screens of data.
  1. In the forms constructor remove the code to assign the View directly and instead:
    1. Create a new instance of the TransitionNavigator class - populating TransitionDuration and TransitionEasing as required.
    2. Create a new Presenter object and make this responsible for creating the View (or have the view supplied via some other means, e.g. DI)
    3. Navigate to the newly created view by using the Forward method on the navigator.
  2. Buttons/Menus on the View can be bound to ICommand properties on the Presenter. These commands can also use the navigator instance to move forward or back trhough new Presenters/Views.
 public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();

            var navigator = new TransitionNavigator( hostCanvas );
            navigator.TransitionDuration = new TimeSpan( 0, 0, 0, 0, 750 );
            navigator.TransitionEasing = new ElasticEasing();

            var welcomePresenter = new WelcomePresenter( navigator );
            navigator.Forward( welcomePresenter.CreateView( hostCanvas ) );
        }
    }

FAQ

How to create a View using XAML

Last edited Nov 9, 2009 at 12:26 PM by spencen, version 1

Comments

No comments yet.