One of the most compelling reasons to download an app is the number of Universal App Reviews in the store. This tutorial will look at adding a Review App Button to our completely empty About Page. There are various places you can surface the Review App Function, commonly it’ll be available on an About or Info page, or you may choose to have a Review Reminder. As with a number of things with UWP apps, the Universal App Review Method changed slightly from Windows Phone 8’s MarketPlaceTask, let’s take a look…
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.
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.
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…
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.
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.
I’m sure you’re probably all aware that Windows 10 is out, (if not in the news then the nagging to upgrade), I recently took the plunge and upgraded my PC and tablet and have to say I’m rather impressed. Along with the Operating System I also upgraded my development environment to Visual Studio 2015 Community to start taking a look at Windows 10 Apps, (and maybe start dabbling in Xamarin now that it’s so accessible). In light of this, now seems as good a time as any to start looking at implementing our Morse Coder App as a Windows 10 Universal App.
Windows 10 Universal Apps differ from Windows 8.1 and Windows Phone 8.1 apps in that they require only a single Project for the UI, where the 8.1 apps would have had Windows, Windows Phone, and a Shared Project; Windows 10 requires only a single project. By the end of this post we should have a functioning Windows 10 app, with all the current functionality from the existing Desktop Version, running on both the Phone Emulator and the Desktop (and everything in between).
In certain circumstances Visual Studio will quite happily suggest to add namespaces into Shared Projects that will then fail to compile. It’s an obvious issue to resolve, with the bottom line being that the Namespaces must exist in all Platform Projects in order for it to be referenced by the Shared Project.
Continue reading “Universal App Gotchas : Namespaces must exist in all Platform Projects”
User controls offer a way to abstract common areas of your User Interface in a reusable package, allowing you to simplify your views and push some of the complexity of your UI into more manageable pieces. This tutorial will focus on Data Binding to Properties on a User Control from a ViewModel.
By the end of this post we should have a basic User Control bound against some Commands living in the MainViewModel to manipulate the content of the Input, in our case, we’ll offer a way to input Morse Code (dots/dashes) outside of needing to use a Keyboard in preparation for extending the App to translate both ways from the User Interface.
Continue reading “Morse Coder Part 7 : Data Binding User Controls”
In Universal Apps the ApplicationData.LocalSettings Property in the Windows.Storage namespace can be used to persist Application Settings. It stores your data into an ApplicationDataContainer, which ultimately provides a wrapper around a Dictionary<string, object> and manages the persistence around the application lifecycle for you.
It can be helpful to be able to reference your Application Settings without needing to cast them from the object stored in the dictionary to the relevant type before consumption every time. We’ll look at wrapping an interface around our Application Settings, giving us the object types, along with the ability to be able to use application settings in our UI at design time.
How do we know that our Morse Code Translation Logic is working correctly? This is where Unit Tests prove to be a valuable tool to have in our toolkit. There are a number of Test Frameworks available, NUnit, XUnit, etc. Given that we’re using PCLs targeting Universal Apps, our choices are limited slightly at this stage, so for simplicity and speed of getting up and running we can use the Libraries and Test projects bundled with Visual Studio. There’s masses of documentation and blog posts around Unit Testing and Test Driven Development (TDD) so I won’t go into the why’s here, but if you’re new to the concept I would recommend you read The Three Rules of TDD by Robert C Martin (Uncle Bob).
(If we were following strict TDD, these tests would have been written before we created the translators, but we’ll look past that for now!)