One app across multiple devices

While I’m usually one for releasing apps, this is the first time that I’ve delved into developing libraries for other people to use.

After having started to look at Windows Universal app development properly, coming from a Silverlight app background has been somewhat difficult with quite a few changes being made to the way you have to develop apps. While there are usually alternative equivalents baked into the SDKs, I’m one for making things easy to port across so I created Universal Triggers for Windows Universal app development.

Windows Phone Silverlight developers should be familiar with triggers. Triggers came as part of Expression Blend to make it easier for developers to bind commands to events on framework elements or take advantage of Expression’s Storyboard actions.

Universal Triggers gives you very similar functionality to your Windows Runtime applications meaning that you can use it in your Windows Phone 8.1 and Windows Store apps like you would your Silverlight ones.

Here is an example of how you can use the Universal Triggers library in your Windows Phone RT app:


<TextBox Text="{Binding SearchText}">
                <i:Triggers>
                    <i:EventTrigger EventName="TextChanged">
                        <i:InvokeCommandAction Command="{Binding SearchCommand}" CommandParameter="{Binding SearchText}" />
                    </i:EventTrigger>
                </i:Triggers>
            </TextBox>

As well as invoking ICommand’s, as stated above, you can also use a Storyboard action to begin animations or transitions through Expression Blend storyboarding.

If you’d like to take the Universal Triggers library for a spin in your Universal Windows apps, you can grab the nuget package from within Visual Studio or run the following command in the Package Manager Console:

Universal Triggers

Join the discussion 2 Comments

Leave a Reply