1 / 34

Windows 8 for Existing .NET Developers

Windows 8 for Existing .NET Developers. Tim Heuer Program Manager Windows Developer Experience Microsoft Corporation. Some UI platforms I’ve worked on…. Access/VBA Delphi VB3->6 (+ASP) “Cool” VB.NET Palm UI Windows Forms WAP ASP.NET ( WebForms ) SharePoint ( WebParts ). WAP

beulah
Download Presentation

Windows 8 for Existing .NET Developers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windows 8 for Existing.NET Developers Tim Heuer Program Manager Windows Developer Experience Microsoft Corporation

  2. Some UI platforms I’ve worked on… • Access/VBA • Delphi • VB3->6 (+ASP) • “Cool” • VB.NET • Palm UI • Windows Forms • WAP • ASP.NET (WebForms) • SharePoint (WebParts) • WAP • Windows Forms • SharePoint (WebParts) • ASP.NET (WebForms) • Windows Presentation Foundation (WPF) • Silverlight • Windows Phone • Windows 8

  3. The ones I liked… • Access/VBA • Delphi • VB3->6 (+ASP) • “Cool” • VB.NET • Palm UI • Windows Forms • WAP • ASP.NET (WebForms) • SharePoint (WebParts) • WAP • Windows Forms • SharePoint (WebParts) • ASP.NET (WebForms) • Windows Presentation Foundation (WPF) • Silverlight • Windows Phone • Windows 8

  4. .NET

  5. Windows 8

  6. You already have the skills to build Windows 8 apps with C# and VB

  7. Using the Windows Runtime feels natural and familiar from C# and Visual Basic

  8. .NET Framework andWinRT • .NET (and C# and Visual Basic) is alive and well • Windows Runtime (Windows.*) native APIs projected

  9. [DllImport(“kernel32.dll”)]

  10. The C# code you have to write today… [DllImport("avicap32.dll", EntryPoint="capCreateCaptureWindow")]static extern intcapCreateCaptureWindow(stringlpszWindowName, intdwStyle, intX, intY, intnWidth, intnHeight, inthwndParent, intnID); [DllImport("avicap32.dll")] static extern boolcapGetDriverDescription(intwDriverIndex, [MarshalAs(UnmanagedType.LPTStr)] ref string lpszName, intcbName, [MarshalAs(UnmanagedType.LPTStr)] ref string lpszVer, intcbVer); // more and more of the same

  11. The C# code you get to write on Windows 8 using Windows.Media.Capture;varui = newCameraCaptureUI();ui.PhotoSettings.CroppedAspectRatio = newSize(4, 3);varfile = awaitui.CaptureFileAsync(CameraCaptureUIMode.Photo);if(file != null) {var bitmap = newBitmapImage() ; bitmap.SetSource(awaitfile.OpenAsync(FileAccessMode.Read)); Photo.Source = bitmap;}

  12. .NET Framework andWinRT • .NET (and C# and Visual Basic) is alive and well • Windows Runtime (Windows.*) native APIs projected • Can use C#/VB to createWinRT components • Async everywhere: await/async keywords are your friends • Reference assemblies for .NET Framework Core • Surface area specific for targeting Windows Runtime apps • Redundancy removed when matching WinRT API exists • Portable Class Library projects • Shared code at source and binary level • Great for framework developers when possible

  13. Extension methods bridge the gap between Windows Runtime and managed code

  14. Streams Code Sample FileOpenPickerpicker = newFileOpenPicker();picker.FileTypeFilter.Add("*"); StorageFilefile = awaitpicker.PickSingleFileAsync(); Windows.Storage.Streams.IInputStreaminputStream =awaitfile.OpenReadAsync(); System.IO.Stream stream = inputStream.AsStreamForRead();System.IO.StreamReader reader = newStreamReader(stream);string contents = reader.ReadToEnd();

  15. Understanding WinRT and Windows 8 for .NET ProgrammersPodcast with Immo Landwerth, PM on the .NET Framework teamhttp://aka.ms/winrtnetfx

  16. Development Patterns • Code-behind approaches • Simpler apps • Event-driven • Coupling UI to logic • Model-View-ViewModel (MVVM) • Separation of concerns • More easily testable (TDD) • Binding-driven • No Behavior support currently

  17. demo Using existing .NET patterns in Windows 8 apps

  18. In Windows 8, your .NET skills extend to C++ and JavaScript developers!

  19. You can build Windows Runtime components that project into C++ or JavaScriptby following a few simple rules

  20. Only the public types and members in your WinRT components need to follow these simple rules

  21. Structs can only have public data fields API signatures must use only Windows Runtime types All types must be sealed (except XAML controls) Only supports system provided generic types

  22. Visual Studio has built-in support for building Windows Runtime component projects using C#/VB

  23. demo Building Windows Runtime Components in C#

  24. Windows.UI.Xaml

  25. Windows.UI.Xaml • Same XAML primitives • Optimized for touch experiences • New UI Controls, familiar XAML structure • GridView/ListView • SemanticZoom • AppBar • Animation Library • ThemeAnimations and Transitions • Extensibility • Large 3rd party ecosystem still thriving

  26. demo Tour around some new XAML

  27. Resources and Localization • Common resource APIs for WinRT • No strongly-typed class generation from resource file • Folder- or file-based convention • RESW == RESX in schema • Windows 8 only supports String resources • XAML leverages a ‘merge’ technique for markup • String- and file-based resources compiled into PRI • Visual Studio indexes all files for you

  28. demo Resources and Localization

  29. Data for Apps • WCF endpoints • Add Service Reference still works! • OData • In RP: Ultimate only, future will be NuGet/standalone • Anonymous type binding • Local Storage • IsolatedStorageWindows.Storage • ESE (Jet) • SQLite

  30. demo Accessing Data Binding Data Debugging databinding

  31. Summary and More… • You can use .NET for Apps and more • Consider Portable Libraries as a method for code-share targeting • Create WinRT components when desired/needed • You can leverage your XAML/.NET skills to be successful quickly in the Windows Store!

  32. You already have the skills to build Windows 8 apps with C# and VB

More Related