Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Windows Application Development Cookbook
Windows Application Development Cookbook

Windows Application Development Cookbook: Discover over 125 solution-based recipes to help you build applications for smartphones, tablets, and desktops

Arrow left icon
Profile Icon Marcin Jamro
Arrow right icon
$54.99
Paperback Dec 2016 512 pages 1st Edition
eBook
$38.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Marcin Jamro
Arrow right icon
$54.99
Paperback Dec 2016 512 pages 1st Edition
eBook
$38.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$38.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Windows Application Development Cookbook

Chapter 2. Designing a User Interface

In this chapter, we will cover the following recipes:

  • Adding a button
  • Adding a text block
  • Adding a textbox
  • Adding a password box
  • Adding a checkbox
  • Adding a combobox
  • Adding a listbox
  • Adding an image
  • Adding controls programmatically
  • Arranging controls vertically
  • Arranging controls horizontally
  • Arranging controls in a scrollable view
  • Defining a page-limited style
  • Defining a global style
  • Applying styles programmatically
  • Arranging controls in a grid
  • Arranging controls in absolute positions
  • Choosing date and time
  • Adding icons to app bars
  • Creating and using a user control
  • Presenting a message dialog
  • Adjusting design based on the device type
  • Localizing content in XAML
  • Localizing content programmatically
  • Forcing the current language

Introduction

In the previous chapter, you learned how to start your adventure of developing applications for smartphones, tablets, and desktops running on the Windows 10 operating system. In the next step, it is crucial to get to know how to design particular pages within the application to provide the user with a convenient user interface that works smoothly on screens with various resolutions.

Fortunately, designing the user interface is really simple using the XAML language and Microsoft Visual Studio Community 2015. You can use a set of predefined controls, such as textboxes, checkboxes, images, or buttons. What is more, you can easily arrange controls in various variants, either vertically, horizontally, or in a grid. This is not all, because you can prepare your own controls that could be placed on many pages within the application. It is also possible to prepare dedicated versions of particular pages for various device families, such as mobile or desktop.

You have already...

Adding a button

When developing applications, you can use a set of predefined controls among which a button exists. It allows you to handle the event of pressing the button by a user. Of course, the appearance of the button can be easily adjusted, for instance, by choosing a proper background or border, as you will see in this recipe.

The button can present textual content. However, it can also be adjusted to the user's needs, for instance, by choosing a proper color or font size. This is not all, because the content shown on the button does not have to be only textual. For instance, you can prepare a button that presents an image instead of text, text over an image, or text located next to the small icon that visually informs about the operation. Such modifications are presented in the following part of this recipe as well.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a button to the page and handle the Click...

Adding a text block

Very often, it is necessary to show some labels on the page. Such a task can be accomplished using the TextBlock control, which is the main subject of this recipe. Here, you will learn how to display static text on the page as well as how to format it.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a text block and handle the Tapped event, perform the following steps:

  1. Place the TextBlock control on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:
            <Page (...)> 
                <Grid (...)> 
                    <TextBlock 
                        Text="Exemplary justified content (...)" 
                        TextAlignment="Justify" 
                        MaxLines="3" 
                        TextTrimming="CharacterEllipsis" 
                        TextWrapping="Wrap" 
                        LineHeight="30...

Adding a textbox

Another task that is frequently performed in applications is entering different types of information, such as a first or last name, an e-mail address, or a phone number. You could easily allow a user to type a text using the TextBox control. In this recipe, you will learn how to place it on the page, modify its appearance, as well as handle events related to typing data within such a control.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a textbox and handle some of its events, perform the following steps:

  1. Place the TextBox control on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:
            <Page (...)> 
                <Grid (...)> 
                    <TextBox 
                        PlaceholderText="Type a first name..." 
                        BorderBrush="#4a4a4a" 
                        BorderThickness="3" 
                    ...

Adding a password box

The previously described TextBox control is great for entering various kinds of information. However, it is not a perfect solution for typing passwords. To handle this type of information, the PasswordBox control is available. You will learn how to use it in this recipe.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a password box and handle the PasswordChanged event, perform the following steps:

  1. Place the PasswordBox control on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:
            <Page (...)> 
                <Grid (...)> 
                    <PasswordBox 
                        PlaceholderText="Type a password..." 
                        VerticalAlignment="Center" 
                        HorizontalAlignment="Stretch" 
                        Margin="20" /> 
                </Grid> 
            </Page>...

Introduction


In the previous chapter, you learned how to start your adventure of developing applications for smartphones, tablets, and desktops running on the Windows 10 operating system. In the next step, it is crucial to get to know how to design particular pages within the application to provide the user with a convenient user interface that works smoothly on screens with various resolutions.

Fortunately, designing the user interface is really simple using the XAML language and Microsoft Visual Studio Community 2015. You can use a set of predefined controls, such as textboxes, checkboxes, images, or buttons. What is more, you can easily arrange controls in various variants, either vertically, horizontally, or in a grid. This is not all, because you can prepare your own controls that could be placed on many pages within the application. It is also possible to prepare dedicated versions of particular pages for various device families, such as mobile or desktop.

You have already learned how...

Adding a button


When developing applications, you can use a set of predefined controls among which a button exists. It allows you to handle the event of pressing the button by a user. Of course, the appearance of the button can be easily adjusted, for instance, by choosing a proper background or border, as you will see in this recipe.

The button can present textual content. However, it can also be adjusted to the user's needs, for instance, by choosing a proper color or font size. This is not all, because the content shown on the button does not have to be only textual. For instance, you can prepare a button that presents an image instead of text, text over an image, or text located next to the small icon that visually informs about the operation. Such modifications are presented in the following part of this recipe as well.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a button to the page and handle the Click event, perform...

Adding a text block


Very often, it is necessary to show some labels on the page. Such a task can be accomplished using the TextBlock control, which is the main subject of this recipe. Here, you will learn how to display static text on the page as well as how to format it.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a text block and handle the Tapped event, perform the following steps:

  1. Place the TextBlock control on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <Grid (...)> 
                    <TextBlock 
                        Text="Exemplary justified content (...)" 
                        TextAlignment="Justify" 
                        MaxLines="3" 
                        TextTrimming="CharacterEllipsis" 
                        TextWrapping="Wrap" 
                        LineHeight="30" 
           ...

Adding a textbox


Another task that is frequently performed in applications is entering different types of information, such as a first or last name, an e-mail address, or a phone number. You could easily allow a user to type a text using the TextBox control. In this recipe, you will learn how to place it on the page, modify its appearance, as well as handle events related to typing data within such a control.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a textbox and handle some of its events, perform the following steps:

  1. Place the TextBox control on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <Grid (...)> 
                    <TextBox 
                        PlaceholderText="Type a first name..." 
                        BorderBrush="#4a4a4a" 
                        BorderThickness="3" 
                    ...

Adding a password box


The previously described TextBox control is great for entering various kinds of information. However, it is not a perfect solution for typing passwords. To handle this type of information, the PasswordBox control is available. You will learn how to use it in this recipe.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a password box and handle the PasswordChanged event, perform the following steps:

  1. Place the PasswordBox control on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <Grid (...)> 
                    <PasswordBox 
                        PlaceholderText="Type a password..." 
                        VerticalAlignment="Center" 
                        HorizontalAlignment="Stretch" 
                        Margin="20" /> 
                </Grid> 
            </Page> 
    ...

Adding a checkbox


In the previous recipes, you learned how a user can type text values and passwords within your application. But what about other types of data, such as a confirmation of accepting the rules? In such a case, the CheckBox control can be used, as you will see in this recipe.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a checkbox and handle some of its events, perform the following steps:

  1. Place the CheckBox control on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <Grid (...)> 
                    <CheckBox 
                        Content="I have read and accepted the rules." 
                        IsChecked="True" 
                        Foreground="RoyalBlue" 
                        FontSize="16" 
                        VerticalAlignment="Center" 
                        HorizontalAlignment...

Adding a combobox


In many forms, it is necessary to choose a value from a predefined set, for example, in the case of a category of news or a supported language. Such a task can be accomplished using the ComboBox control. It allows you to choose a particular value from a drop-down list. In this recipe, you will learn how to use it and adjust its appearance.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a combobox and handle the SelectionChanged event, perform the following steps:

  1. Place the ComboBox control with supported languages on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <Grid (...)> 
                    <ComboBox 
                        SelectedIndex="1" 
                        Header="Language" 
                        Foreground="RoyalBlue" 
                        BorderBrush="RoyalBlue" 
         ...

Adding a listbox


In the case of the collapsed ComboBox control, only one item is presented. However, if you want to show more items as well as allow to select multiple elements in the same time, you can use ListBox. The usage of this control is explained in this recipe.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a listbox and handle the SelectionChanged event, perform the following steps:

  1. Place the ListBox control with the supported languages on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <Grid (...)> 
                    <ListBox 
                        SelectedIndex="1" 
                        SelectionMode="Single" 
                        VerticalAlignment="Center" 
                        HorizontalAlignment="Center"> 
                        <ListBoxItem Content="Polish" Tag="PL" /> 
     ...

Adding an image


Modern applications often contain attractive designs that include images. In this recipe, you will learn how to present images in your application using the Image control.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a .jpg file to the project, add the Image control, and handle the Tapped event, perform the following steps:

  1. Add the Image.jpg file to the Assets directory within the project. To do so, refer to these steps:

    1. Navigate to Add | Existing Item... from the context menu of the Assets node in the Solution Explorer window.

    2. Choose the file in the Add Existing Item window.

    3. Click on the Add button.

  2. Place the Image control on the page and adjust its appearance by modifying the content of the MainPage.xaml file as follows:

            <Page (...) Background="Black"> 
                <Grid (...)> 
                    <Image 
                        Source="/Assets/Image.jpg" 
                 ...

Adding controls programmatically


You have learned how to use the XAML language to place controls on the page and configure them. However, it does not mean that controls must only be created in a declarative way using XAML. In this recipe, you will learn how to create a button and add it to the Grid control programmatically, using the C# language.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To add a button and adjust its appearance programmatically, perform the following steps:

  1. Specify the name of the Grid control by modifying the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <Grid 
                    Name="Grid" 
                    Background="{ThemeResource  
                        ApplicationPageBackgroundThemeBrush}"> 
                </Grid> 
            </Page> 
    

  2. Create and configure a new button and add it to the Grid control by modifying the constructor...

Arranging controls vertically


Pages often contain many controls that must be arranged in some way. One of the most natural ways is arranging them vertically, one below another. This linear method is supported by the StackPanel control. In this recipe, you will learn how to use it to prepare the page with a registration form consisting of a few other controls, namely TextBlock, TextBox, PasswordBox, ComboBox, CheckBox, and Button.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To arrange controls vertically to create a simple registration form, modify the content of the MainPage.xaml file as follows:

    <Page (...)> 
        <StackPanel Background="White" Padding="20"> 
            <TextBlock 
                Text="Create an account" 
                FontSize="26" 
                Margin="0 0 0 20" /> 
            <TextBox 
                Header="Login" 
              ...

Arranging controls horizontally


Apart from arranging controls vertically, it is possible to place them in a linear horizontal way, where a control is placed on the right-hand side of the previous one. This task can be accomplished using StackPanel as well, as shown in this recipe.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To arrange controls horizontally, modify the content of the MainPage.xaml file, as shown in the following code:

        <Page (...)> 
            <StackPanel 
                Orientation="Horizontal" 
                Background="White" 
                Padding="20"> 
                <TextBlock 
                    Text="Grade:" 
                    VerticalAlignment="Center" /> 
                <Button Content="1" Margin="20 0 10 0" /> 
                <Button Content="2" Margin="10 0" /> 
                <Button Content="3" Margin...

Arranging controls in a scrollable view


As already mentioned, the StackPanel control does not automatically allow you to scroll its content. For this reason, when the screen is not big enough, some parts could just disappear. Of course, such a situation should not occur. For this reason, in this recipe, you will learn how to use ScrollViewer to scroll the photo gallery created as a collection of images, presented in StackPanel.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To arrange controls in a scrollable view to form a simple photo gallery, perform the following steps:

  1. Add four images (named Gallery1.jpg, Gallery2.jpg, Gallery3.jpg, and Gallery4.jpg) to the Assets directory, as explained in the Adding an image recipe.

  2. Modify the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <ScrollViewer  
                    Padding="10" 
                    ScrollViewer.VerticalScrollBarVisibility...

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...

Defining a global style


Page-limited styles are a powerful mechanism to design the various elements on the page consistently. However, what should you do to make the whole application consistent? Do you need to copy such styles to all the pages? Absolutely not, because you can move the definition of styles to the App.xaml file to use them in the whole application. You will learn how to do it in this recipe.

As an example, you will create a simple menu page with a few buttons, such as Dashboard, News, and Gallery. To make the design consistent across the whole application, all buttons should have the same appearance specified by the global style.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To prepare a simple menu page with a globally-defined style for buttons, you need to perform the following steps:

  1. Specify the global style for the Button and ScrollViewer controls by modifying the content of the App.xaml file as follows:

         ...

Applying styles programmatically


According to the information presented in the two previous recipes, you can use styles to easily adjust the design of your application. However, do you know that you can also apply styles programmatically? Thus, you can dynamically control the appearance of user interface. In this recipe, you will learn how to get data of the style defined in the page resources and apply it to an element with a suitable type.

As an example, you will prepare a page that presents four images. By default, they have a black border with a width of 3 pixels and its opacity set to 30%. After clicking on each image, its opacity should be changed to 100% and the border color should be set to blue. You will solve this problem by defining two styles, namely for active and inactive elements and applying a proper style after tapping on the photo.

Getting ready

To step through this recipe, you will only need the automatically generated project.

How to do it...

To prepare an example of applying...

Arranging controls in a grid


The arrangement of controls in a linear way is not the only possible option. You can also arrange controls in a grid by specifying in which rows and columns each control should be located. What is interesting is that the available solution gives developers a lot of flexibility, such as defining the width of columns and the height of rows. In this recipe, you will learn how to define a grid and arrange controls within it.

As an example, you will design a simple calculator with TextBlock for the results and 16 Button controls (with 0-9 digits, +, -, *, /, =, and a comma).

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To create a simple calculator demonstrating arrangement of controls in a grid, you need to perform the following steps:

  1. Specify styles for Button and TextBlock controls. Do this by modifying the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <Page...

Arranging controls in absolute positions


In some scenarios, it may be necessary to place controls in absolute positions in a given area. Such a task can be performed using the Canvas control. In this recipe, you will learn how to place a rectangle and an ellipse over the image in a fixed location, specified in pixels from the top-left corner.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To create a page presenting how to arrange controls in absolute positions, perform the following steps:

  1. Add the Image.jpg file to the Assets directory.

  2. Modify the content of the MainPage.xaml file as follows:

            <Page (...) Background="Black"> 
                <Canvas> 
                    <Canvas.Background> 
                        <ImageBrush 
                            ImageSource="/Assets/Image.jpg" 
                            Stretch="UniformToFill" /> 
                    </Canvas.Background> 
    ...

Choosing date and time


When a user of your application enters a particular date or time, such as a birth date or a time when an order should be delivered, it is a good idea to provide a built-in mechanism of choosing the date and time. Such mechanisms allow a user to select them in a comfortable way, without the necessity of entering such information in a textual form. In this recipe, you will learn how to choose a date either from the calendar or a list and how to specify time by choosing a particular hour and minute.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To allow a user to choose date or time in a few ways, perform the following steps:

  1. To add the CalendarDatePicker control to the page, which will allow a user to choose a date from the calendar, modify the content of the MainPage.xaml file as follows:

            <Page (...)> 
                <StackPanel Padding="20"> 
                    <CalendarDatePicker...

Adding icons to app bars


If you want to allow the user to have quick access to some useful operations, you can equip the page with either the top or bottom app bar. Such bars are collapsed by default, but they can be easily expanded by the user by clicking on them. In this recipe, you will learn how to add icons to both the top and bottom app bars, as well as how to handle the scenario of pressing particular icons.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To prepare an example that shows how to add either top or bottom app bar and handle an event of clicking on icons located within an app bar, perform the following steps:

  1. To add a bottom app bar with three icons, modify the content of the MainPage.xaml file as follows:

            <Page (...) Background="Black"> 
                <Grid Padding="20" Background="White"> 
                    <TextBlock  
                        Text="Exemplary page that contains an...

Creating and using a user control


While developing applications, you can use a set of predefined controls, but it is also possible to define your own ones. Such an approach is really beneficial and important. In this recipe, you will learn how to create your own user control (representing a tile with an icon and a title), define its properties, and place it on the page. What is more, you will see how to use the NuGet Package Manager to download additional packages.

Getting ready

To step through this recipe, you only need the automatically generated project.

How to do it...

To install the additional package from the NuGet Package Manager, define an example user control, and place it on the page, you should perform the following steps:

  1. Install PropertyChanged.Fody using the NuGet Package Manager. To do this, refer to the following steps:

    1. Choose Manage NuGet Packages... from the context menu of the project node in the Solution Explorer window.

    2. Click on the Browse tab in the newly opened window.

    3. Type...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Learn to build applications for Windows 10, the latest Windows version
  • Develop your applications to be compatible with smartphones, tablets, and desktops
  • This guide is packed with recipes covering major solutions to day-to-day problems faced by Windows programmers

Description

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.

Who is this book for?

The book is dedicated to programmers with various experience of developing applications for Windows-based smartphones, tablets, and desktops—even beginners can find suitable content.

What you will learn

  • Start developing universal applications for Windows 10
  • Design user interface in the XAML language
  • Use the MVVM design pattern with data binding
  • Store data in files and in a database
  • Use multimedia content and animations
  • Capture data from built-in sensors
  • Handle various Internet-based scenarios
  • Test the application and submit it to the Windows Store
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 21, 2016
Length: 512 pages
Edition : 1st
Language : English
ISBN-13 : 9781786467720
Vendor :
Microsoft
Category :
Languages :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Dec 21, 2016
Length: 512 pages
Edition : 1st
Language : English
ISBN-13 : 9781786467720
Vendor :
Microsoft
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 158.97
Windows Application Development Cookbook
$54.99
Mastering C# and .NET Framework
$48.99
C++ Windows Programming
$54.99
Total $ 158.97 Stars icon

Table of Contents

10 Chapters
1. Getting Started Chevron down icon Chevron up icon
2. Designing a User Interface Chevron down icon Chevron up icon
3. MVVM and Data Binding Chevron down icon Chevron up icon
4. Data Storage Chevron down icon Chevron up icon
5. Animations and Graphics Chevron down icon Chevron up icon
6. Multimedia Chevron down icon Chevron up icon
7. Built-in Sensors Chevron down icon Chevron up icon
8. Internet-based Scenarios Chevron down icon Chevron up icon
9. Testing and Submission Chevron down icon Chevron up icon
A. Useful Resources Chevron down icon Chevron up icon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela