• Save
Top 10 Differences between developing Windows Phone and Store apps
Upcoming SlideShare
Loading in...5

Top 10 Differences between developing Windows Phone and Store apps



Slides from IE Hackathon session (June 8 2013) on the differences between the Windows Phone and Windows Store APIs.

Slides from IE Hackathon session (June 8 2013) on the differences between the Windows Phone and Windows Store APIs.



Total Views
Views on SlideShare
Embed Views



27 Embeds 11,712

http://www.sharpgis.net 9314
http://sharpgis.net 1439
http://www.iter.dk 365
http://iter.dk 247
http://localhost 137
http://binaryworld.net 134
https://twitter.com 29
http://webcache.googleusercontent.com 7
http://cloud.feedly.com 5
http://www.silverreader.com 4
http://www.google.nl 4
http://translate.googleusercontent.com 4
http://www.newsblur.com 4
http://ranksit.com 3
http://feedspot.com 2
http://prlog.ru 2
http://cageyjames.webfactional.com 2
http://xianguo.com 1
http://sharpgis8.rssing.com 1
http://www.google.com 1
http://sharpgis6.rssing.com 1
http://www.goread.io 1
http://adeep16.slorf.com 1
http://www.365dailyjournal.com 1
http://adebayo16.swaltsu.com 1
http://a-deep16.vinoreka.com 1
http://feedly.com 1



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • System.Windows vs. Windows.UI.Xaml....System.Windows.MarkupWindows.UI.Xaml.MarkupSystem.Windows.MediaWindows.UISystem.SizeWindows.Foundation.SizeSystem.WindowsWindows.FoundationBe careful though:System.Windows.Media.Color vs. Windows.UI.Color: Exists on WP, but comes from WinRT types (+there's also an XNA version)
  • Pointers vs. MouseSystem.Windows.Input.MouseEventHandlerWindows.UI.Xaml.Input.PointerEventHandler WP: (Double)Tap, WinStore: (Double)Tapped WP: MouseLeftButtonDown, WinStore: PointerPressed
  • System.Windows.Input.MouseEventHandlerWindows.UI.Xaml.Input.PointerEventHandler WP: (Double)Tap, WinStore: (Double)Tapped WP: MouseLeftButtonDown, WinStore: PointerPressed
  • (use NuGet package, but no compression).. Include link to Gzip code + pcl
  • Switching to Dispatcher threadDispatcher.HasThreadAccessvsCheckAccess(), BeginInvoke, RunAsyncvar dispatcher = System.Windows.Deployment.Current.Dispatcher; var dispatcher = Windows.UI.Xaml.Window.Current.Dispatcher;
  • WinStoreWindows.ApplicationModel.DesignMode.DesignModeEnabledWinPhoneSystem.ComponentModel.DesignerProperties.IsInDesignTool WPF System.ComponentModel.DesignerProperties.GetIsInDesignMode(UIElement)
  • WinStoreWindows.ApplicationModel.DesignMode.DesignModeEnabledWinPhoneSystem.ComponentModel.DesignerProperties.IsInDesignTool WPF System.ComponentModel.DesignerProperties.GetIsInDesignMode(UIElement)
  • Different parameterMultipleFramesBack button vs hooking up backspace.
  • Different parameterMultipleFramesBack button vs hooking up backspace.
  • Snap View. Privacy Policy
  • WinPhone: Roaming settingsWinRT UI Stack Remote Debugging via Wifi No DWrite or Direct2D on WinPhoneWinStore:WriteableBitmap.Render()RadialBrushes XNA LOB Company Hub APIs (was told “Wait for //build/ conference” this week) Rich Binding support Remote debugging via USB (issue with some wifi networks) See article http://www.itwriting.com/blog/6779-how-to-test-and-debug-an-app-on-surface-rt-in-a-hotel-room.html Build apps using JavaScript (PhoneGap for WP if you really want to)Behaviors

Top 10 Differences between developing Windows Phone and Store apps Top 10 Differences between developing Windows Phone and Store apps Presentation Transcript

  • Windows Store & Phone Devtop 10 differences@dotMorten
  • Who’s who?WindowsPhonePlatform of choiceC# since .NET 1.0 beta 2XAML fulltime since Silverlight v1.1Work: Building SDKs formappingSilverlight, WPF, WindowsPhone, Windows StoreHobby:Same thing but I get to be boss Windows 8WPF
  • Who’s who #2What is your preferred coding language?C#VB.NETJavaScriptC++OtherWhat platform do you develop most for?Windows 8Windows PhoneWPFWindows FormsOther
  • The Inspiration for This Talk• ArcGIS Runtime SDK for WindowsA Mapping SDK for Windows Phone, Store and Desktop.Core runtime (C++ & DirectX)C++ interopC++/CX WinRT APIC# importsPublic .NET SDK (C#)Store Phone Desktop
  • Use Portable Class Library if you canPro:Build, test and compile once.Con:Won’t work for UI codeCan’t use non-PCL librariesNo Platform specific codeUse shared source only when you can’tPro:Can always fully use the platform.Can use non-PCL componentsCon:Likely more testing involved.Visual Studio gets a little “weird” about it.More stuff to compileOr… use them both!But why share source?
  • PCL And Shared Source TogetherWindows Phone8Portable Class LibrariesWindows 8ServicesViewModels (limited or abstract)ModelsViews (XAML)App LifecycleNavigationViews (XAML)ConvertersShared ViewModels (Add as Link)Storage, AlertsPlatform SpecificDifferent XAMLDifferent ControlsSame DataBindingsSame Commands forKey InteractionsConverters
  • Quick Code Share Demo
  • sounds too good to be true?99% harpmusicIt almost is...At least 99% shared code.What’s in the remaining 1%?1% drums
  • #if NETFX_CORE //Store#elif WINDOWS_PHONE //Phone#elif SILVERLIGHT //Silverlight or Phone#else //WPF/Desktop#endifOr combine them:#if NETFX_CORE || WINDOWS_PHONE#if !SILVERLIGHT#if SILVERLIGHT && !WINDOWS_PHONEEncapsulate platform specific code using#if [conditional]
  • 1. Namespaces#if NETFX_COREusing Windows.UI.Xaml;#elseusing System.Windows;#endifPhone / WPF / Silverlight Windows StoreSystem.Windows Windows.UI.XamlSystem.Windows.Media Windows.UISystem Windows.Foundation*SystemSystem.Size Windows.Foundation.Size*System.Windows.Media.ColorWindows.UI.ColorMicrosoft.Xna.Framework.Graphics.ColorWindows.UI.Color
  • Windows Phone/WPF/Silverlightxmlns:local="clr-namespace:MyNamespace;assembly=MyApp"Windows Store XAMLxmlns:local="using:MyNamespace"2. XAML Namespace declaration
  • 3. Touch/Mouse/PenTouch is kind oflike a mouseEverything isjust a pointer
  • Windows Phone Windows StoreMouseEventHandler => PointerEventHandlerMouseLeftButtonDown => PointerPressedMouseMove => PointerMovedMouseEnter/Exit => PointerEntered/ExitedTap => TappedDoubleTap => DoubleTappedHold => Holding3. Touch/Mouse/Pen #2
  • Windows Phone:Make web requests using “WebClient”Install NuGet package “Microsoft.Net.Http”Windows Store:Make web requests using “HttpClient”4. HttpClient vs. WebClientHttpClient
  • Use the Dispatcher to call the UI ThreadHowever they look different...5. The Dispatcher
  • Windows PhoneWindows Store:5. The Dispatcher #2
  • 5. The Dispatcher #3
  • public class MyViewModel{public MyViewModel(){if(IsDesign) // <- different on every platformMyProperty = "Lorem Ipsum";elseGenerateData();}public string MyProperty { get; set; }…}6. Generating Design Time Data
  • public bool IsDesign{get{#if NETFX_COREreturn Windows.ApplicationModel.DesignMode.DesignModeEnabled;#elif SILVERLIGHT // includes WINDOWS_PHONEreturn System.ComponentModel.DesignerProperties.IsInDesignTool;#else //WPFreturnSystem.ComponentModel.DesignerProperties.GetIsInDesignMode(this);#endif}}6. Generating Design Time Data#2
  • Windows Phone:this.NavigationService.Navigate(new Uri("/MyPage.xaml?parameter="+param.ToString(),UriKind.Relative));this.NavigationService.Navigate(new Uri("MyAssembly;component/MyPage.xaml", UriKind.Relative));Windows Store:this.Frame.Navigate(typeof(MyPage), param);7. Page Navigation
  • Windows Phone:protected override void OnNavigatedTo(NavigationEventArgs e){string parameter = NavigationContext.QueryString["parameter"];base.OnNavigatedTo(e);}Windows Store:protected override void OnNavigatedTo(NavigationEventArgs e){object parameter = e.Parameter;base.OnNavigatedTo(e);}7. Page Navigation
  • GridView  LongListSelector8. Controls #2
  • Windows StoreIf your app has internet access,it MUST have a privacy policy!Windows PhoneIf your app uses the location service,it MUST have an option to disable it!9. Certification Requirements
  • 10. Where did it go?Phone StoreRoaming Settings ⛔ UI Controls System.Windows Windows.Xaml.UIBehaviors  ⛔Remote debugging USB WiFi/LANDirectWrite, Direct2D ⛔ WritableBitmap.Render  ⛔RadialBrush  ⛔XNADeprecated(use DirectX)⛔(use DirectX)LOB Company Hub APIs  ⛔Binding.StringFormat  ⛔Native JavaScript Apps ⛔(use PhoneGap) Render DirectX to XAML DrawingSurface SurfaceImageSource
  • ReferencesMSDN MagazineSharing Code between Windows Phone 8and Windows 8 Applicationshttp://esriurl.com/CodeShare1TechEd 2013 SessionBuild It Once For Both: Writing Code andDesigning for Windows 8 and WindowsPhone 8http://esriurl.com/CodeShare2
  • Questions?Blog (and slides):www.sharpgis.netTwitter:@dotMortenE-mail:mnielsen@esri.com