You need to recommend which code must be implemented to meet the requirements…

###BeginCaseStudy###
Case Study: 4
Fabrikam, Inc
Overview
Fabrikam, Inc. is a realtor in the United States.
Fabrikam grants its customers access to a web site, where they can search for houses for rent
and for sale. Its customers can enter basic requirements, such as location, number of rooms,
dimensions, and a price range. The web site displays a list of houses that meet the customers’
criteria. The customers can then view more details about each house and can add a listing to a
favorites list.
Requirements
Business Goals
Fabrikam plans to provide a more interactive experience for its customers. Fabrikam is
creating a video tour for each listing. The video tours can be used to visit the property
virtually.
Fabrikam plans to create a Windows Store app on Windows 8.1 RT and Windows 8.1 Pro
devices.
General Requirements
Fabrikam identifies the following general requirements for the app:
• The app interface must be available in English, Spanish, and French.

• The app must provide the customers with the ability to perform searches the
same way that the current web site does.
• It is expected that the customers will view more than 3,000 pictures annually.
The main page of the app must show a list of the last 10 pictures that were
viewed.
• If pictures are added to a listing that is in a customer’s favorites list, the
pictures must be downloaded automatically from Windows Azure. This must
occur if the app is suspended or not running.
Printing Requirements
Customers must be able to print the details of a listing from the details page by clicking a
button within the app.
You plan to add the following XAML markup to the listing details page:
<Button x:Name=”btnPrint Content=”Print” Click=”InvoicePrint” />.
Video Tour Requirements
Fabrikam identifies the following requirements for the video tours:
• Customers must be able to play the video tour on a different device by using a
button within the app.
• When a customer clicks the details of a listing, the app must start downloading
the video tour in the background.
• When the app starts, the app must verify whether there are any pending
downloads, and resume any paused downloads.
• The last five viewed video tours that are not on the customer’s favorites list
must be cached for subsequent viewing.
• Customers must be able to download all of the video tours for the properties
that they added to their favorites list.
• The property details page must contain a MediaElement control that will be
used to play the video tour of the property.
• When downloading the video tours, the app must remain responsive, and each
download must be processed on a separate thread.
Package.appxmanifest

###EndCaseStudy###

DRAG DROP
You need to recommend which code must be implemented to meet the requirements for resuming
the video tour downloads.
Develop the solution by selecting and ordering the required code snippets. You may not need all of
the code snippets.

###BeginCaseStudy###
Case Study: 4
Fabrikam, Inc
Overview
Fabrikam, Inc. is a realtor in the United States.
Fabrikam grants its customers access to a web site, where they can search for houses for rent
and for sale. Its customers can enter basic requirements, such as location, number of rooms,
dimensions, and a price range. The web site displays a list of houses that meet the customers’
criteria. The customers can then view more details about each house and can add a listing to a
favorites list.
Requirements
Business Goals
Fabrikam plans to provide a more interactive experience for its customers. Fabrikam is
creating a video tour for each listing. The video tours can be used to visit the property
virtually.
Fabrikam plans to create a Windows Store app on Windows 8.1 RT and Windows 8.1 Pro
devices.
General Requirements
Fabrikam identifies the following general requirements for the app:
• The app interface must be available in English, Spanish, and French.

• The app must provide the customers with the ability to perform searches the
same way that the current web site does.
• It is expected that the customers will view more than 3,000 pictures annually.
The main page of the app must show a list of the last 10 pictures that were
viewed.
• If pictures are added to a listing that is in a customer’s favorites list, the
pictures must be downloaded automatically from Windows Azure. This must
occur if the app is suspended or not running.
Printing Requirements
Customers must be able to print the details of a listing from the details page by clicking a
button within the app.
You plan to add the following XAML markup to the listing details page:
<Button x:Name=”btnPrint Content=”Print” Click=”InvoicePrint” />.
Video Tour Requirements
Fabrikam identifies the following requirements for the video tours:
• Customers must be able to play the video tour on a different device by using a
button within the app.
• When a customer clicks the details of a listing, the app must start downloading
the video tour in the background.
• When the app starts, the app must verify whether there are any pending
downloads, and resume any paused downloads.
• The last five viewed video tours that are not on the customer’s favorites list
must be cached for subsequent viewing.
• Customers must be able to download all of the video tours for the properties
that they added to their favorites list.
• The property details page must contain a MediaElement control that will be
used to play the video tour of the property.
• When downloading the video tours, the app must remain responsive, and each
download must be processed on a separate thread.
Package.appxmanifest

###EndCaseStudy###

DRAG DROP
You need to recommend which code must be implemented to meet the requirements for resuming
the video tour downloads.
Develop the solution by selecting and ordering the required code snippets. You may not need all of
the code snippets.

Answer: See the explanation

Explanation:
Box 1:

Box 2:

Box 3:

Box 4:

Box 5:

Note:
* GetCurrentDownloadsAsync
Returns a collection of pending downloads that are not associated with a group.
* await Task.WhenAny
By using Task.WhenAny, you can start multiple tasks at the same time and process them one by one
as they’re completed rather than process them in the order in which they’re started.
* From scenario:
/When a customer clicks the details of a listing, the app must start downloading the video tour in the
background.
/ When the app starts, the app must verify whether there are any pending downloads, and resume
any paused downloads.
/ When downloading the video tours, the app must remain responsive, and each download must be
processed on a separate thread.
Incorrect:
* Not: await Task.WhenAll (need separate threads)
You apply the Task.WhenAll method to a collection of tasks. The application of WhenAll returns a
single task that isn’t complete until every task in the collection is completed. The tasks appear to run
in parallel, but no additional threads are created. The tasks can complete in any order.
* Not: RequestUnconstrainedDownloadsAsync
Used to request an unconstrained download operation
When this method is called the user is provided with a UI prompt that they can use to indicate their
consent for an unconstrained operation.
An unconstrained transfer operation will run without the resource restrictions normally associated
with background network operations while a device is running on battery.
http://msdn.microsoft.com/en-us/library/windows/apps/br207128.aspx
http://msdn.microsoft.com/en-us/library/hh194914(v=vs.110).aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *