Book Image

Windows Application Development Cookbook

By : Marcin Jamro
Book Image

Windows Application Development Cookbook

By: Marcin Jamro

Overview of this book

Need to ensure you can always create the best Windows apps regardless of platform? What you need are solutions to the biggest issues you can face, so you can always ensure you’re making the right choices and creating the best apps you can. The book starts with recipes that will help you set up the integrated development environment before you go ahead and design the user interface. You will learn how to use the MVVM design pattern together with data binding, as well as how to work with data in different file formats. Moving on, you will explore techniques to add animations and graphics to your application, and enable your solution to work with multimedia content. You will also see how to use sensors, such as an accelerometer and a compass, as well as obtain the current GPS location. You will make your application ready to work with Internet-based scenarios, such as composing e-mails or downloading files, before finally testing the project and submitting it to the Windows Store. By the end of the book, you will have a market-ready application compatible across different Windows devices, including smartphones, tablets, and desktops.
Table of Contents (17 chapters)
Windows Application Development Cookbook
About the Author
About the Reviewer

Defining a page-limited style

One of the important tasks while developing applications is to ensure the design is consistent within the whole solution. However, copying and pasting the same code in several places, for instance, for each button located on the page, is not a suitable solution. In the case of any modifications, you will need to perform many changes and ensure that all the occurrences of a previous value have been replaced correctly. For this reason, it is a beneficial approach to use styles.

In this recipe, you will learn how to apply page-limited styles to the controls on the page. What is more, two kinds of styles will be taken into account: styles applied automatically to all the controls of a given type and styles applied only to a particular subset of controls.

As an example, you will create a photo gallery with the header. Each photo is represented by an Image control placed within Border. A style should be automatically applied to all Border elements to set its borders...