SlideShare une entreprise Scribd logo
1  sur  49
Windows Runtime Apps 
Jaliya Udagedara 
MVP (Visual C#)
Windows Store App 
Windows Phone Store App
Windows Runtime Apps
Windows Runtime contains 
more than 90% of Windows 
Phone Runtime
protected override async void OnLaunched(LaunchActivatedEventArgs e) 
{ 
ApplicationExecutionState state = e.PreviousExecutionState; 
ActivationKind kind = e.Kind; 
///... 
}
• App is suspended 
• All code stopped 
• No timers tick 
• No events fire 
• Process still alive and in memory 
• Code has a chance to respond 
(next slide)
private async void OnSuspending(object sender, SuspendingEventArgs e) 
{ 
var deferral = e.SuspendingOperation.GetDeferral(); 
await SuspensionManager.SaveAsync(); 
deferral.Complete(); 
}
• Same app is resumed 
• Same process, same memory so 
values of variables are intact 
• All code runs 
• Code has a chance to respond. 
Launch Switcher
public App() 
{ 
this.InitializeComponent(); 
this.Suspending += this.OnSuspending; 
this.Resuming += App_Resuming; 
} 
void App_Resuming(object sender, object e) 
{ 
// TODO: whatever you need to do to resume your app 
}
http://bit.ly/w8Resuming
Window 
Frame 
Page 
Window
protected override void OnLaunched(LaunchActivatedEventArgs e) 
{ 
Frame rootFrame = Window.Current.Content as Frame; 
// Do not repeat app initialization when the Window already has 
// content, just ensure that the window is active 
if (rootFrame == null) 
{ 
// Create a Frame to act as the navigation context and navigate 
// to the first page 
rootFrame = new Frame(); 
... 
// Place the frame in the current Window 
Window.Current.Content = rootFrame; 
} 
if (rootFrame.Content == null) 
{ 
// Navigate to the first page 
rootFrame.Navigate(typeof(MainPage), e.Arguments); 
} 
// Ensure the current window is active 
Window.Current.Activate(); 
}
private void itemListView_ItemClick(object sender, ItemClickEventArgs e) 
{ 
// Navigate to the appropriate destination page, configuring the new page 
// by passing required information as a navigation parameter 
var itemId = ((MyListViewItem)e.ClickedItem).UniqueId; 
Frame.Navigate(typeof(MyDetailPage), itemId); 
}
private void btnGoBack_Click( 
object sender, RoutedEventArgs e) 
{ 
if (this.Frame.CanGoBack) 
this.Frame.GoBack(); 
}
public sealed partial class SecondPage : Page 
{ 
... 
protected override void OnNavigatedTo(NavigationEventArgs e) 
{ 
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed; 
} 
protected override void OnNavigatedFrom(NavigationEventArgs e) 
{ 
Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed; 
} 
async void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e) 
{ 
e.Handled = true; // We've handled this button press 
if (SecondaryUI.Visibility == Visibility.Visible ) // If the secondary UI is visible, hide it 
{ 
FadeOutSecondaryStoryboard.Begin(); 
} 
else 
{ 
if (Frame.CanGoBack) 
Frame.GoBack(); 
} 
}
Add Windows Phone 8.1 or Windows 8.1
Context Switcher in the Editor
Context Switcher in the XAML Editor
Better IntelliSense
Devices Window
Switching Startup Projects
• Universal App
Thank You! 
http://www.jaliyaudagedara.blogspot.com/

Contenu connexe

Tendances

Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3
martha leon
 
Orsiso
OrsisoOrsiso
Orsiso
e27
 

Tendances (9)

How to use redux with react hooks in react native application
How to use redux with react hooks in react native applicationHow to use redux with react hooks in react native application
How to use redux with react hooks in react native application
 
Jquery Example PPT
Jquery Example PPTJquery Example PPT
Jquery Example PPT
 
MVC In Depth, part 2, Tommy Maintz
MVC In Depth, part 2, Tommy MaintzMVC In Depth, part 2, Tommy Maintz
MVC In Depth, part 2, Tommy Maintz
 
Java eventhandling
Java eventhandlingJava eventhandling
Java eventhandling
 
Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3
 
Orsiso
OrsisoOrsiso
Orsiso
 
Even more java script best practices
Even more java script best practicesEven more java script best practices
Even more java script best practices
 
Controls in action
Controls in actionControls in action
Controls in action
 
Async best practices DotNet Conference 2016
Async best practices DotNet Conference 2016 Async best practices DotNet Conference 2016
Async best practices DotNet Conference 2016
 

En vedette

Getting Started Developing Universal Windows Platform (UWP) Apps
Getting Started Developing Universal Windows Platform (UWP) AppsGetting Started Developing Universal Windows Platform (UWP) Apps
Getting Started Developing Universal Windows Platform (UWP) Apps
Jaliya Udagedara
 
Windows Phone Application Development
Windows Phone Application DevelopmentWindows Phone Application Development
Windows Phone Application Development
Jaliya Udagedara
 
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya UdagedaraLambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Jaliya Udagedara
 
Windows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedaraWindows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedara
Jaliya Udagedara
 
Universal Apps for Windows Devices
Universal Apps for Windows DevicesUniversal Apps for Windows Devices
Universal Apps for Windows Devices
Jaliya Udagedara
 

En vedette (14)

Let's Explore C# 6
Let's Explore C# 6Let's Explore C# 6
Let's Explore C# 6
 
Building Universal Apps for Windows and Windows Phone
Building Universal Apps for Windows and Windows PhoneBuilding Universal Apps for Windows and Windows Phone
Building Universal Apps for Windows and Windows Phone
 
Introduction to Universal Apps
Introduction to Universal AppsIntroduction to Universal Apps
Introduction to Universal Apps
 
Introduction to Universal Apps-Jaliya Udagedara
Introduction to Universal Apps-Jaliya UdagedaraIntroduction to Universal Apps-Jaliya Udagedara
Introduction to Universal Apps-Jaliya Udagedara
 
Getting Started Developing Universal Windows Platform (UWP) Apps
Getting Started Developing Universal Windows Platform (UWP) AppsGetting Started Developing Universal Windows Platform (UWP) Apps
Getting Started Developing Universal Windows Platform (UWP) Apps
 
Debugging C# Applications
Debugging C# ApplicationsDebugging C# Applications
Debugging C# Applications
 
Windows Runtime Apps
Windows Runtime AppsWindows Runtime Apps
Windows Runtime Apps
 
Windows communication foundation (part1) jaliya udagedara
Windows communication foundation (part1)    jaliya udagedaraWindows communication foundation (part1)    jaliya udagedara
Windows communication foundation (part1) jaliya udagedara
 
Windows Phone Application Development
Windows Phone Application DevelopmentWindows Phone Application Development
Windows Phone Application Development
 
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya UdagedaraLambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
Lambda Expressions in C# From Beginner To Expert - Jaliya Udagedara
 
Universal Apps for Windows Devices
Universal Apps for Windows DevicesUniversal Apps for Windows Devices
Universal Apps for Windows Devices
 
Windows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedaraWindows communication foundation (part2) jaliya udagedara
Windows communication foundation (part2) jaliya udagedara
 
Generics In and Out
Generics In and OutGenerics In and Out
Generics In and Out
 
Universal Apps for Windows Devices
Universal Apps for Windows DevicesUniversal Apps for Windows Devices
Universal Apps for Windows Devices
 

Similaire à Windows Runtime Apps

The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it means
Robert Nyman
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao PauloJavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
Robert Nyman
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
Mahmoud Hamed Mahmoud
 
JavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos Aires
JavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos AiresJavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos Aires
JavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos Aires
Robert Nyman
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, MontevideoJavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
Robert Nyman
 
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos AiresJavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
Robert Nyman
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, ChileJavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
Robert Nyman
 
Java Programming Must implement a storage manager that main.pdf
Java Programming Must implement a storage manager that main.pdfJava Programming Must implement a storage manager that main.pdf
Java Programming Must implement a storage manager that main.pdf
adinathassociates
 
Windows Phone 7: Navigating Between Pages
Windows Phone 7: Navigating Between PagesWindows Phone 7: Navigating Between Pages
Windows Phone 7: Navigating Between Pages
Jussi Pohjolainen
 

Similaire à Windows Runtime Apps (20)

State management in android applications
State management in android applicationsState management in android applications
State management in android applications
 
The Open Web and what it means
The Open Web and what it meansThe Open Web and what it means
The Open Web and what it means
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorial
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao PauloJavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Sao Paulo
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Designing for Windows Phone 8
Designing for Windows Phone 8Designing for Windows Phone 8
Designing for Windows Phone 8
 
Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development Windows Store app using XAML and C#: Enterprise Product Development
Windows Store app using XAML and C#: Enterprise Product Development
 
JavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos Aires
JavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos AiresJavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos Aires
JavaScript APIs - The Web is the Platform - MDN Hack Day - Buenos Aires
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, MontevideoJavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
JavaScript APIs - The Web is the Platform - MDN Hack Day, Montevideo
 
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos AiresJavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
JavaScript APIs - The Web is the Platform - MozCamp, Buenos Aires
 
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, ChileJavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
JavaScript APIs - The Web is the Platform - MDN Hack Day, Santiago, Chile
 
What the FUF?
What the FUF?What the FUF?
What the FUF?
 
Events
EventsEvents
Events
 
Android Pro Recipes
Android Pro RecipesAndroid Pro Recipes
Android Pro Recipes
 
Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!Async task, threads, pools, and executors oh my!
Async task, threads, pools, and executors oh my!
 
Modern Android app library stack
Modern Android app library stackModern Android app library stack
Modern Android app library stack
 
Swing_Introduction.ppt
Swing_Introduction.pptSwing_Introduction.ppt
Swing_Introduction.ppt
 
Java Programming Must implement a storage manager that main.pdf
Java Programming Must implement a storage manager that main.pdfJava Programming Must implement a storage manager that main.pdf
Java Programming Must implement a storage manager that main.pdf
 
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
Three Simple Chords of Alternative PageObjects and Hardcore of LoadableCompon...
 
Windows Phone 7: Navigating Between Pages
Windows Phone 7: Navigating Between PagesWindows Phone 7: Navigating Between Pages
Windows Phone 7: Navigating Between Pages
 

Dernier

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Windows Runtime Apps

  • 1. Windows Runtime Apps Jaliya Udagedara MVP (Visual C#)
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7. Windows Store App Windows Phone Store App
  • 9.
  • 10. Windows Runtime contains more than 90% of Windows Phone Runtime
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. protected override async void OnLaunched(LaunchActivatedEventArgs e) { ApplicationExecutionState state = e.PreviousExecutionState; ActivationKind kind = e.Kind; ///... }
  • 20. • App is suspended • All code stopped • No timers tick • No events fire • Process still alive and in memory • Code has a chance to respond (next slide)
  • 21. private async void OnSuspending(object sender, SuspendingEventArgs e) { var deferral = e.SuspendingOperation.GetDeferral(); await SuspensionManager.SaveAsync(); deferral.Complete(); }
  • 22. • Same app is resumed • Same process, same memory so values of variables are intact • All code runs • Code has a chance to respond. Launch Switcher
  • 23. public App() { this.InitializeComponent(); this.Suspending += this.OnSuspending; this.Resuming += App_Resuming; } void App_Resuming(object sender, object e) { // TODO: whatever you need to do to resume your app }
  • 25.
  • 26.
  • 27.
  • 29. protected override void OnLaunched(LaunchActivatedEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has // content, just ensure that the window is active if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate // to the first page rootFrame = new Frame(); ... // Place the frame in the current Window Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // Navigate to the first page rootFrame.Navigate(typeof(MainPage), e.Arguments); } // Ensure the current window is active Window.Current.Activate(); }
  • 30. private void itemListView_ItemClick(object sender, ItemClickEventArgs e) { // Navigate to the appropriate destination page, configuring the new page // by passing required information as a navigation parameter var itemId = ((MyListViewItem)e.ClickedItem).UniqueId; Frame.Navigate(typeof(MyDetailPage), itemId); }
  • 31. private void btnGoBack_Click( object sender, RoutedEventArgs e) { if (this.Frame.CanGoBack) this.Frame.GoBack(); }
  • 32.
  • 33.
  • 34. public sealed partial class SecondPage : Page { ... protected override void OnNavigatedTo(NavigationEventArgs e) { Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed; } protected override void OnNavigatedFrom(NavigationEventArgs e) { Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed; } async void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e) { e.Handled = true; // We've handled this button press if (SecondaryUI.Visibility == Visibility.Visible ) // If the secondary UI is visible, hide it { FadeOutSecondaryStoryboard.Begin(); } else { if (Frame.CanGoBack) Frame.GoBack(); } }
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40. Add Windows Phone 8.1 or Windows 8.1
  • 41. Context Switcher in the Editor
  • 42. Context Switcher in the XAML Editor
  • 46.
  • 47.

Notes de l'éditeur

  1. Windows 8 and Windows Phone 8 : low convergence Windows 8.1 and Windows Phone 8.1 : high convergence
  2. Windows 8 and Windows Phone 8 : low convergence Windows 8.1 and Windows Phone 8.1 : high convergence
  3. Manifest A manifest is a set of metadata that describes the assembly itself (name, version, required external assemblies, etc.).
  4. Speak about .NET Native
  5. Hybrid programming languages are supported.
  6. SuspendingOperation.GetDeferral | getDeferral method Requests that the app suspending operation be delayed.