Tag: C#

.NET and Linux Bluetooth

Ever needed to perform some Bluetooth LE operations on your Linux device, whether it’s Raspberry PI, Ubuntu, or some other distribution? Yes, me too! In this article, we’ll dive right into using the Plugin.BlueZ NuGet package and show you how to get started using it. Feel free to contribute to the open source project over at the Suess Labs GitHub page, https://github.com/SuessLabs/Plugin.BlueZ. UPDATE! We are migrating towards the next generation package, Linux.Bluetooth NuGet package!The GA functionality is the same and future enhancements are coming soon, such as Battery monitoring. In this article, we’ll perform a simple Scanning for Devices based…

Visual Studio Linux Debugger

The VS Linux Debugger is an open-source tool created to assist with remotely deploying and debugging your Linux applications from Visual Studio 2022. Check it out on the Microsoft Marketplace or GitHub. To get started using it today it’s as easy as 1-2-3.. or perhaps, 2-3 Overview Before getting started, it is recommended to ensure your system has the latest updates. These steps have been tested against Ubuntu 20.04 LTE and 22.04 LTE. Though this project supports everywhere that .NET (Core) is supported, this section outlines steps for Ubuntu 22.04 LTE. It’s recommended to use the official Microsoft Install .NET…

Xamarin.Forms Floating Action Button

This article is a review of the Xamarin.Forms NuGet package, Floating Action Button (FAB). Here, we’ll be discussing what the library is, and how to use MVVM binding with Prism.Forms’ Navigation Service, and then finish up with some of the pros/cons of the library. For the full project, check out my GitHub page, Learn.FloatingActionButton, which this article references. I stumbled upon the Floating Action Button while responding to an inquiry made on the Xamarin Slack in regards to the forums thread, “Can I maintain a single static navigation service from Prism.Forms“. If you’re wondering, I’m, “User29117“. What is it? The…

Unit Testing Events with Timeouts

Ever need to perform a unit test on and want to timeout while waiting for an event? Doing a quick google search for, “C# unit test timeout waiting for event” yields interesting mixed results. Here are a few different methods for completing such a task. Method 1 – Task.WhenAny The following uses the System.Threadding.Task.WhenAny method wrapped inside of our async method, WaitUntil(..). Th Method 2 – Synchronous ManualResetEvent Slightly different implementation without the use of Tasks. Method 3 – TaskCompletionSource Method 4 – Task.WhenAny Asyncronyously awaiting Task.WhenAny allows you to provide a delay as you can see below.