template setup guides & guidelinesdownload.microsoft.com/documents/hk/technet... · contoso...
TRANSCRIPT
demo
demo
demo
demo
<ToggleSwitch
Header="Wi-fi networking"
x:Name="MyToggle"
/>
MyToggle.Toggled += new RoutedEventHandler(ToggleWifi);
HTML:
<div data-win-control="WinJS.UI.Toggle"
data-win-options="{title: 'Wi-fi networking'}"
id="myToggle"
</div>
"change"
Clear Button Spell Checking
Reveal Button
demo
Contoso Travel Featured destinations Last minute deals
7 night Alaska Cruise
Last Minute Deals
Featured destinations Barcelona, Spain
Last Minute Deals 7 Night Alaska Cruise
Ocean View Cabins
Upgrade from an inside cabin and save
$43/night/person!
Picture windows with ocean and port views
From $2,099 — only $150/night/person based on
double occupancy
Suites
Upgrade from an inside cabin and save
$43/night/person!
Picture windows with ocean and port view
From $2,099 — only $150/night/person do
My Trips Weather 7 days
Chicago (3/11 – 3/19)
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Attractions
My Trips Featured Destinations Top Destinations for 2012
Barcelona, Spain
My Trips City Guide City Guide
Contoso Travel Featured destinations Last minute deals My Trips
7 night Alaska Cruise
Last Minute Deals
Featured destinations Barcelona, Spain
Last Minute Deals 7 Night Alaska Cruise
Ocean View Cabins
Upgrade from an inside cabin and save
$43/night/person!
Picture windows with ocean and port views
From $2,099 — only $150/night/person based on
double occupancy
Suites
Upgrade from an inside cabin and save
$43/night/person!
Picture windows with ocean and port view
From $2,099 — only $150/night/person do
My Trips Weather 7 days
Chicago (3/11 – 3/19) Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Attractions
My Trips Featured Destinations
Top Destinations for 2012
Barcelona, Spain
Contoso Travel Featured destinations Last minute deals My Trips
7 night Alaska Cruise
Last Minute Deals
Featured destinations Barcelona, Spain
Last Minute Deals 7 Night Alaska Cruise
Ocean View Cabins
Upgrade from an inside cabin and save
$43/night/person!
Picture windows with ocean and port views
From $2,099 — only $150/night/person based on
double occupancy
Suites
Upgrade from an inside cabin and save
$43/night/person!
Picture windows with ocean and port view
From $2,099 — only $150/night/person do
My Trips Weather 7 days
Chicago (3/11 – 3/19) Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Today 54/43
Mostly Sunny
Attractions
My Trips Featured Destinations
Top Destinations for 2012
Barcelona, Spain
demo
Apps do not get notified when
they are getting terminated
//Register for the Suspending event and call suspendingHandler when received Windows.UI.WebUI.WebUIApplication.addEventListener("suspending", suspendingHandler); //Handle the suspending event and save the current user session using WinJS sessionState function suspendingHandler(eventArgs) { //We are getting suspended } //Register for the Resuming event and call resumingHandler when received Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler); function resumingHandler() { //We are getting resumed, in general do nothing }
demo
Scenario You should….
User
Launches
App
Splash
screen
User
Launches
App
Splash
screen
User
Launches
App
Splash
screen
User
Launches
App
Splash
screen
User
Launches
App
Splash
screen
User
Launches
App
Splash
screen
demo
Trigger Condition
InternetAvailable,
InternetNotAvailable,
SessionConnected,
SessionDisconnected,
UserNotPresent,
UserPresent
TimeTrigger*
PushNotificationTrigger*
SessionStart*
ControlChannelTrigger*(**)
ServicingComplete
SessionConnected
SessionDisconnected
SmsReceived
TimeZoneChange
UserAway/UserPresent,
LockScreenApplicationAdded/Removed
OnlineIdConnectedStateChangeInternetAvailable
InternetAvailable/InternetNotAvailable
NetworkNotificationChannelReset
NetworkStateChange
MaintenanceTrigger
PushNotificationTrigger**
*requires lock permission
**can run in App (not BackgroundHost.exe)
function RegisterSampleBackgroundTaskWithCondition()
{
var builder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder();
builder.name = "BackgroundTestWorker";
builder.taskEntryPoint = "BackgroundTestWorker.js";
// run a timetrigger for every 15 minutes
var myTrigger = new Windows.ApplicationModel.Background.TimeTrigger(15, true);
builder.setTrigger(myTrigger);
// required condition: internetAvailable
var condition = new
Windows.ApplicationModel.Background.SystemCondition(Windows.ApplicationModel.Backgroun
d.SystemConditionType.internetAvailable);
builder.addCondition(condition);
// register the task
var task = myTaskBuilder.register();
task.addEventListener("progress", task_Progress);
task.addEventListener("completed", task_Completed);
}
<Application Id="App" StartPage="default.html"> <VisualElements DisplayName="SimpleBackgroundTask" Logo="images\logo.png" SmallLogo="images\smalllogo.png" Description="SimpleBackgroundTask" ForegroundText="light" BackgroundColor="#000000"> <LockScreen Notification="badge" BadgeLogo="badgelogo.png" /> <SplashScreen Image="images\splashscreen.png" /> </VisualElements> <Extensions> <Extension Category="windows.backgroundTasks" StartPage="backgroundTaskLogger.js"> <BackgroundTasks> <Task Type="timer" /> <Task Type="systemEvent" /> </BackgroundTasks> </Extension> </Extensions> </Application>
demo
CPU resource quota Refresh period
Lock screen app
Non-lock screen app
Square (1x1) Wide (2x1)
Square (1x1) Wide (2x1)
demo
Windows Phone Developer blog, March 2011
// get current product
var currentProduct = Windows.ApplicationModel.Store.CurrentProduct;
// get the license information
var licenseInformation = currentProduct.licenseInformation;
// check to see if the user has an active non-trial license
if (licenseInformation.isTrial) {
// user has trial version of the application // prompt them to purchase before so we can enable full functionality
currentProduct.requestProductPurchaseAsync().then(
function () {
// Purchase succeeded
});
}
// can’t do in-app purchase in trial mode, must convert first
if (!appLicensingInformation.isTrial) { //load the listings with all the products
currentApp.loadListingInformationAsync().then(
function (listing) {
//lookup a specific product
var product1 = listing.productListings.lookup("product1");
if (!product1.isActive) { // purchase
currentApp.requestProductPurchaseAsync("product1").then(
enableProduct1 );
}
});