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”

Universal App Tutorials Part 11 : Value Converters

One of the rules of using MVVM is that your model shouldn’t need to know anything about the UI Layer, and your View should be decoupled from the Model via the ViewModel.  It can often be necessary to have some form of conversion between what our Model understands and what the View would understand.  A common example would be converting a boolean flag to a Visibility State, this is where Value Converters come in.

Outcome

We’ll follow a slightly more domain specific example in this case, converting the TranslationDirection Enumeration Property to a Visibility State for our Morse Input User Control.

Continue reading “Universal App Tutorials Part 11 : Value Converters”

Morse Coder Part 9 : Visual State Triggers

Intro

As we saw when we migrated our Universal Windows App to Windows 10 targetting Phones and PCs with the same set of markup presents us with a challenge…

Windows10-Phone.png

This UI is less than usable!  There are a new set of User Controls made available as part of Windows 10, for example the Relative Panel.  In this post we’ll look at ways we can make our UI adaptive based on the screen size we are targeting.

Outcome

By the end of this post we will have a single app that is usable on PCs, tablets, and Phones.  We’ll be looking into Visual State Triggers in order to alter the size of the text presented in our Input and Output TextBox and TextBlock controls.  Visual State Triggers apply transformations to the base XAML defined, we’ll be using this method to make our app responsive.

Continue reading “Morse Coder Part 9 : Visual State Triggers”