Eager Instantiation of ViewModels with MVVM Light Messaging

Dependency registration in SimpleIoc, by default uses Lazy Instantiation, meaning the object won’t be created until it is requested, in this case, via the property on the ViewModelLocator class.

Due to configuring subscription of a message type in the Constructors of my ViewModels in MVVM Light I recently came across a situation whereby messages were being published prior to them having been subscribed to, meaning that the messages disappeared into the void unhandled.  The ViewModels relating to the pages I had navigated to were available in the ServiceLocator, but the pages that I hadn’t navigated to were not being instantiated.

Continue reading “Eager Instantiation of ViewModels with MVVM Light Messaging”

Universal App Tutorials Part 16 : Styles

Using Styles to create a consistent User Interface is generally considered to be a best practice.  In much the same way as CSS is used on the Web, Styles in XAML provide a similar development experience.

Outcome

By the end of this post we will have implemented a Style to target our About and Settings Buttons on the Home Page. removing some of the duplication in the XAML definitions.

Continue reading “Universal App Tutorials Part 16 : Styles”

Development Team Leadership : First Steps Part 9

Identify Bottlenecks

It’s important to be able to take a top down view of your team and it’s bottlenecks, internal and external.

Bottle Neck
Bottle Neck

External

For example, the inputs to your sprints “should” be nailed down when planning, you might need:

  • a data model definition;
  • web service schema;
  • validation use cases;

…the list goes on.

If they consistently aren’t appearing on time, this is a bottleneck hampering your productivity.  It’s important to raise the alarm. Continue reading “Development Team Leadership : First Steps Part 9”

Universal App Tutorials Part 15 : MVVM Light Messaging

It’s often necessary to “inform” other areas of an application of changes that have occurred.  This can be achieved through Messaging.  In the previous tutorial we created a Settings page and made the TranslationDirection Configurable.  It would be nice if the Main View Model knew about our new Translation Direction setting, let’s look at how we can achieve this.

Outcome

By the end of this tutorial we should have implemented a SettingsChangedMessage, subscribed to it from our MainViewModel and Published it from our SettingsViewModel. Continue reading “Universal App Tutorials Part 15 : MVVM Light Messaging”

Universal App Tutorials Part 14 : Settings Page

Applications generally have a settings page, or similar allowing the user to configure the application.   We laid the groundwork for making the Translation Direction setting configurable in the previous post, let’s look at putting that in to practice.

Outcome

By the end of this tutorial we’ll have a really basic Settings Page, 2 Buttons allowing the user to pick between Morse to Alphabet and Alphabet to Morse, and a TextBlock displaying the current Translation Direction. Continue reading “Universal App Tutorials Part 14 : Settings Page”