Developer Quick Tour

christophwille edited this page Aug 17, 2012 · 3 revisions

This page is intended to get you up and running quickly with the source code.

Please note that although the App's UI is in German and intended for Austrian gas prices, the codebase is in English to make it easier for everyone to dig into.

The project started out with me stuffing everything into the views to test what works and what doesn't in Windows 8 apps. It soon ticked me off because at work I do MVVM, thus I started with simplistic view models and as I went along, needed more and at that point settled for MVVM Light (I usually do Caliburn Micro, but that wasn't available back then).

However, as you will see, some code has remained in the views (because of threading, or Bing Maps). Also, no dependency injection to see here (yet; I stuck to simple static services in this iteration).

The Projects

Sprudelsuche

Startup project. The three main views (MainPage, SprudelDetailPage and AddSprudelSuche) are backed with view models (/ViewModels, using MVVM Light). Those are backed by really simple static services in /Services, plus UI-specific model helpers in /Model.

Implementation note: the reason why there is a list control on AddSprudelSuche for the results of the Nominatim search is that there was no AutoCompleteBox available at that time.

App.xaml: you need to enter your Bing Maps credentials there.

High-level explanation of functionality:

  • MainPage displays three commands (Diesel at current location, Super at current location) as well as manual selection of location (plus type of gas). Once the user has added at least one favorite, those are displayed next to the commands and can be acted upon using the App bar.
  • AddSprudelSuche this is the page that handles the manual selection of locations. First, the user enters a search string. Then, from the results, picks one location which is then displayed in the map control. Lastly, by tapping on a gas type, the user is redirected to SprudelDetailPage.
  • SprudelDetailPage has three modes: location mode (display gas type X at current location), favorites mode (ie when activated from MainPage or secondary tile), or manual search display mode (a new manual location). Depending on modes, certain App bar commands are enabled.

NotificationsExtensions

Unmodified from the Windows SDK. Is used for tile / badge notifications.

SprudelSuche.ThirdParty

Various third party code like a simple storage helper, and extended TextBox (think UpdateSourceTrigger), simple serialization for state plus the variable grid that is used on MainPage.

SprudelSuche.Portable

The models and interfaces for platform-specific implementations of proxies and repositories.

SprudelSuche.WinRT

The implementations for the interfaces of the previous project.

Implementation note: plain simple storage as XML, no SQLite (breaking up into queries and results planned for enabling roaming of favorites)

SprudelSuche.Tasks

One scheduled task that is enabled via Preferences (see SprudelSuche.PreferencesUserControl)