Sharing code win8 wp8
-
Upload
matthidinger -
Category
Documents
-
view
1.033 -
download
3
description
Transcript of Sharing code win8 wp8
![Page 1: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/1.jpg)
Matt Hidinger
Clarity Consulting
Sharing code withWindows 8 and Windows Phone 8
![Page 2: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/2.jpg)
Clarity <3 Windows Phone
![Page 3: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/3.jpg)
Agenda
Developer Choice
Sharing Strategies
Demos (code)
UX considerations
![Page 4: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/4.jpg)
Your appsYour way
Windows Phone 8 Developer Platform
XAML Apps Direct3D Apps
XAML Maps Geolocation Sensors In-App Purchase Direct3D
HTML XML Threading Touch Speech XAudio2
Phone Features Push Camera Video Proximity Media
Foundation
Calendar Wallet Contacts Core Types VoIP STL
Multitasking Live Tiles Memory Async Enterprise CRT
C# and VB C#, VB, and C++ C++
File system, Networking, Graphics, Media
Core Operating System
![Page 5: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/5.jpg)
shared coreFull WinRT
11,000 members
Windows Phone Runtime
2,800 shared members600 new members
![Page 6: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/6.jpg)
Sharing techniques
![Page 7: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/7.jpg)
Common Structure
Windows 8 Windows Phone 8
![Page 8: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/8.jpg)
Model-View-ViewModel
Windows 8public class Product{ public int Id { get; set; }
[DataMember(Name = "text")] public string Text { get; set; }
[DataMember(Name = "complete")] public bool Complete { get; set; }}
public class Product{ public int Id { get; set; }
[DataMember(Name = "text")] public string Text { get; set; }
[DataMember(Name = "complete")] public bool Complete { get; set; }}
Windows Phone 8
![Page 9: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/9.jpg)
Ctrl-CCtrl-V
![Page 10: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/10.jpg)
“Add as Link”
![Page 11: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/11.jpg)
04/08/2023Microsoft confidential11
“Add as Link”
Windows 8 Windows Phone 8
![Page 12: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/12.jpg)
04/08/2023
Dispatcher Differences
Windows 8Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>{ MyTextBlock.Text = "Hello from the UI thread!";});
Deployment.Current.Dispatcher.BeginInvoke(() =>{ MyTextBlock.Text = "Hello from the UI thread!";});
Windows Phone 8
![Page 13: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/13.jpg)
04/08/2023Microsoft confidential13
#if Conditional Blocks
Windows 8#if NETFX_COREDispatcher.RunAsync(CoreDispatcherPriority.Normal, () => {#endif
#if WINDOWS_PHONEDeployment.Current.Dispatcher.BeginInvoke(() => {#endif
Windows Phone 8
![Page 14: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/14.jpg)
One Source
One Project
One Binary
Multiple Platforms!
Portable Class Libraries
![Page 15: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/15.jpg)
Portable Class Library and MVVM
![Page 16: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/16.jpg)
Your skills
You know C#You know .NETYou know and love XAML (right?)
![Page 17: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/17.jpg)
Demo
![Page 18: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/18.jpg)
UX Considerations
![Page 19: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/19.jpg)
04/08/2023Microsoft confidential19
Web Service
![Page 20: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/20.jpg)
04/08/2023Microsoft confidential20
UI Differences and XAML
![Page 21: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/21.jpg)
Different Form Factors Require Different UX
Windows Phone 8 Windows 8
Screen Size
800x480
1280x720
1280x768
Screen Size
1024x768
2,560x1,440
everything in between
![Page 22: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/22.jpg)
Different Form Factors Require Different UX
Windows Phone 8 Windows 8
Orientation
Portrait
Landscape
Orientation
Portrait
Landscape
Snapped
![Page 23: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/23.jpg)
Different Controls
GridView
Group-able
Array of Tiles
Dynamic item size
![Page 24: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/24.jpg)
Microsoft confidential24
Different Controls
Semantic Zoom
Pinch-zoom through grouped list of items
![Page 25: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/25.jpg)
Microsoft confidential25
Different Form Factors Require Different UX
Panorama
Introduction and exploratory content
![Page 26: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/26.jpg)
Microsoft confidential26
Different Form Factors Require Different UX
LongListSelector
Headers and Footers
Group header navigation
![Page 27: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/27.jpg)
Microsoft confidential27
Translating UX
Semantic Zoom Pivot
![Page 28: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/28.jpg)
Microsoft confidential28
Translating UX – Details View
Horizontal scroll Vertical scroll
![Page 29: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/29.jpg)
Microsoft confidential29
Different Form Factors Require Different UXGridView LongListSelector
![Page 30: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/30.jpg)
Way cross platform
![Page 31: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/31.jpg)
http://bit.ly/NXVdHX
![Page 32: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/32.jpg)
Summary
![Page 33: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/33.jpg)
04/08/2023Microsoft confidential33
• Mix and match techniques
• Share Models, Helpers, Services, ViewModels• Linked files• Portable Class Libraries
• Using #if conditionals for small code differences
• Using Extension methods to bridge implementation differences• Async-await model for HttpWebResponse/Request
• Focus on the user experience that works for the form factor
Windows 8 / Windows Phone 8 Apps Are a Perfect Match
![Page 34: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/34.jpg)
04/08/2023Microsoft confidential34
WP7 can do Async/Await!
Install-Package Microsoft.Bcl.Async
PCLs can add this package too!
Some WP7 Love
![Page 35: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/35.jpg)
MVVM Frameworks
Caliburn.Micro
MVVM Light
![Page 36: Sharing code win8 wp8](https://reader034.fdocuments.in/reader034/viewer/2022042613/545d05f3b1af9f370a8b47bb/html5/thumbnails/36.jpg)
Lessons Learned
Share code – architect with sharing in mind
Maximize the user experience in the UI
Use existing skills and knowledge