Tag: Windows

  • Learn WinUI 3 2nd Edition

    Learn WinUI 3 2nd Edition

    I received a physical copy of Alvin Ashcraft’s new WinUI book last week. I had the pleasure of being a technical reviewer for the book and it has been great to see it taking shape from the early chapters on WinUI history and core concepts through to delivering your completed app in the Microsoft Store. Along the way it even has chapters on interoperability with Blazor and going cross-platform with Uno. This allows you to apply the WinUI skills you learn throughout the book to a wide variety of device types.

    I highly recommend it if you are interested in building apps for Windows and beyond using the latest XAML stack, fluent design and Windows SDK.

    More details are available on the Packt website. It’s available through all the usual physical and online book sellers.

  • Asking for Permission

    Asking for Permission

    I’ve been asked a number of times about the process to ask for Bluetooth permission for your app. I’ve been meaning to create something reusable for some time but it has languished on the To Do list for rather too long. I recently noticed that as of .NET 8.0, MAUI will incorporate a Bluetooth permission which simplifies the process for asking for permission in your app in a clean cross-platform way.

    I used this as an opportunity to refactor the library that I had started so I could create the same pattern for Xamarin Forms and .NET MAUI 7.0 so you can get started with it now and then switch to the in-box equivalent when you update your code. You can request permission with a single line of code:

    PermissionStatus status = await Permissions.RequestAsync<InTheHand.Bluetooth.Permissions.Bluetooth>();

    Today InTheHand.Bluetooth.Permissions went live on NuGet and the source is part of the existing 32feet.NET project. You can use this with either the Bluetooth Classic or Bluetooth LE libraries.

    It provides a simple way to request permission, which on some platforms won’t do anything noticeable but on others, such as Android, it will correctly prompt for permission as long as you’ve set up your manifest correctly.