The book Professional C# and .NET Core 1.0 covers – as the title says – C# 6 and .NET Core 1.0. What does this mean for Universal Windows Platform (UWP) developers? What’s in there for UWP?
The book covers topics that are important for professional programmers using C# and .NET. With this, the book covers the following four parts:
- The C# Language
- .NET Core and the Windows Runtime
- Windows Apps
- Web Applications and Services
Let’s get into the details of these sections.
C# 6 and the .NET Framework
The C# Language covers the syntax features of C#, including collections and asynchronous programming. Of course the C# syntax is important programming UWP applications. You can read about new C# 6 features such as the null-conditional operator, string interpolation, expression bodied members, read-only auto properties, the nameof operator, and more.
.NET Core and Windows Runtime
.NET Core Libraries can be used from UWP applications, thus for example it’s possible to use Microsoft.Extensions.DependencyInjection not only from ASP.NET Core, but also from UWP and WPF applications – and this is all covered in the book. Thus nearly every part in this section is important for creating UWP applications, such as creating and synchronizing tasks, working with XML and JSON…
There’s also some special UWP coverage. For example, with the Windows Runtime that is available for UWP applications, different streams are used that implement the interfaces such as IRandomAccessStream, IInputStream, and IOutputStream. With .NET, the Stream class is the base class for all streams. To take advantage of features of .NET Core types, the .NET streams need to be converted to Windows Runtime streams – this is covered in the section Mapping Windows Runtime Types to .NET Types in the chapter Files and Streams (chapter 23).
Using the HttpClient type with UWP applications, the NuGet package delivers a type that already supports HTTP/2, the newest version of this protocol. Chapter 25 (Networking) shows a sample application where you can check websites that already support HTTP/2.
In chapter 26 (Composition), you can read about how to integrate the Managed Extensibility Framework (MEF) with UWP. This chapter covers both WPF as well as UWP, and you can see how code can be shared between these technologies, and see MEF in action with UWP.
In the Localization chapter (chapter 28) you can see the Multilingual App Toolkit in action that helps localizing Universal Windows apps.
Let’s get to the most important part for UWP application developers, the section about Windows Apps:
Chapter 29, Core XAML explains the core features of XAML, such as dependency properties, attached properties, markup extensions and routed events. You learn and learn of the foundations of dependency properties, how routed events differ from WPF routed events, and learn immportant markup extensions.
Styling XAML Apps
Chapter 30, Styling XAML Apps is a huge chapter (> 50 pages) that shows how to draw using shapes, advantages of geometry elements, use transformations, brushes, define styles and resources, create templates, use animations and control states with the Visual State Manager. UWP applications also offer the functionality of transitions.
Transitions make it easier to create compelling apps without the need to think about what makes a cool animation.
Patterns with XAML Apps
To reuse code between WPF and UWP, the MVVM (Model-View-ViewModel) pattern helps a lot. While this pattern is not that hard to understand, by using this pattern other issues come into play. This chapter covers all the different aspects needed on creating apps using the MVVM pattern to include commands, dependency injection containers, event aggregation, resolving of view-models, the repository pattern, and more.
Windows Apps: User Interfaces
Chapter 32, Windows Apps: User Interfaces covers important controls and changed behaviors of Windows 10 apps, such as the Hamburger button, the SplitView, using the RelativePanel with different screen sizes and the AdaptiveTrigger, using the AutoSuggest control, as well as supporting ink in the application. Compiled data binding is a great feature of Universal Apps and also has an important part in this chapter.
Compiled data binding is one of the best new XAML features for the Universal Windows Platform.
Advanced Windows Apps
Chapter 33, Advanced Windows Apps covers different aspects of the Universal Windows Platform. You learn about the application lifetime that is different to desktop applications and store state for the application, use contracts such as for sharing data between apps, use App Services for another way of communication, use the camera to capture videos and photos, use maps and Geoinformation in various ways, make use of sensors such as LigthSensor, Compass, Barometer, Altimeter, and make use of the Accelerometer to let a marble roll over the screen.
Deploying Windows Apps
Chapter 36 not only covers ClickOnce with WPF, but also introduces the Windows App Certification Kit and explains app packages as well as sideloading of Windows apps.
Web Applications and Services
The fourth section of the book mainly covers the server side, e.g. how you can make use of ASP.NET Web API to create REST services that can be called from Universal Windows apps. Another important part – just staying on the client – is Entity Framework Core. This .NET Core library can be used directly from UWP applications accessing MySQL. You no longer need to use a different API to access this database to cache information needed by the user, Entity Framework Core can be used both on the server and on the client.
There are some books that only cover Universal Windows apps – but Professional C# 6 and .NET Core 1.0 has a huge offering for UWP developers – probably more than many books that cover only UWP. Also, check the More Samples available with the code download. Over time I plan to add here a lot of additional UWP samples.
I hope you enjoy the book!
Have fun with programming and learning!
This article just offered some information what’s covered in my books and workshops: