While developing an UWP application I wanted to log unhandled exceptions. My coach mentioned that in WPF you can register a exception handler to handle unhandled exceptions globally. In UWP it works exactly the same way. Add Unhandled Exception Handler NOTE: This solution does not prevent your app from crashing and exiting. This solution only lets you react to unhandled […]
In the previous blog post of this series I wrote about binding ComboBox or ListBox to an enum. Using just the approach described there exposes the enum values directly in […]
In our WPF application we wanted to bind ComboBox and ListBox controls to enums. The WPF way to set up such a binding is described here. This solution works absolutely fine but it requires the definition of an ObjectDataProvider for every enum. This in turn leads to lower maintainability and the code is not reusable. Due to these disadvantages we […]
To have a modern look and feel we decided to align our WPF application to Microsoft Metro style. To achieve this, we used the open source toolkit MahApps.Metro. MahApps.Metro is a toolkit for creating Metro / Modern UI styled WPF applications. The MahApps.Metro project was started back in 2011 by Paul Jenkins. The source is available on GitHub (see MahApps.Metro […]
As mentioned in the previous post of this series the WPF application we implemented follows the MVVM pattern. MVVM stands for Model-View-ViewModel. The MVVM patterns intent is to provide a clean separation of concerns between UI and the business logic. It can be used on all XAML platforms. About MVVM Pattern Microsoft describes the motivation for MVVM pattern as follows […]
Beside the vision and the requirements you also have to have an idea how the WPF application should look like in the end. For that purpose we created a few mock ups during first exchange with the customer in the early stages of the project. In the same stage we also created a process diagram (BPMN) that shows all the […]
Before starting development we first had to set up a new WPF project. The projects target framework is .NET Framework 4.6.2 and we used Microsoft Visual Studio Community 2015 as […]
In the first half of 2017 we implemented a WPF project for one of our customers. The aim of the project was to develop a Surface Pro compatible desktop application for data collection in context of civil engineering. The application allows the user to create, save, edit and export protocols of specific buildings. Furthermore it’s possible to create a PDF […]
In a project of ours I stumbled across the topic on how to control the GPIO interface of a Raspberry Pi 3 using the Windows.Devices.Gpio namespace. The mentioned namespace contains a class called GpioController. This class enables you to establish connection to any pin on the Raspberry Pi. You have to use the static method GpioController.GetDefault() to get an instance […]
As I was working on a project, I had to check if we can use Log4Net for an UWP Application which will run on a Windows 10 IoT device. For setting up the UWP Application, I used Visual Studio 2015 Community Edition. In the new project dialog I chose Blank App (Universal Windows) and used the following settings. Minimum Version: […]
During developing a user control for a WPF UI I encountered a strange null reference exception in the XAML designer. Strange thing was, that when I started the application and switched to the control which contained the user control, everything worked fine. I could’ve just ignored this problem. However since it is very inconvenient writing XAML code without getting a […]
For our current WebApi project we decided to implement OAuth2 authentication with Azure Active Directory. As our API needs to support other authentication mechanisms like Basic and Negotiate beside OAuth2 we implemented multiple authentication filters that, where each filter is responsible for a specific authentication mechanism. One of these authentication filters, the BearerAuthenticationFilter, is responsible to handle requests that contain […]
During development of a PowerShell binary module I had to do deal with two different credential types (System.Management.Automation.PSCredential and System.Net.NetworkCredential) and came across a behaviour I wanted to write down. The PowerShell binary module I developed contains several Cmdlets. One of them defines a parameter of type System.Management.Automation.PSCredential. Inside the Cmdlet we need to have an object of type System.Net.NetworkCredential. […]
We at d-fens use Microsoft Code Contracts every day. And certainly with every great tool there are some things that might benefit from some improvement – and code contracts are […]
Inspired by Transient Fault Handling we created a quick helper class to faciliate the automatic retry of various operation that may fail in today’s interconnected environments. Large parts of our Appclusive framework deal with fetching from and pushing information to various backend systems. As they all can (and eventuall will) fail we needed a flexible approach on how to retry […]
Recently I wanted to create SignalR hubs for client notification based on a list of internal queues. As SignalR is creating Hubs based on their type names I had to find an approach for dynamically defining classes based on the given queue list. In this blog post I show a way on how to do this The Situation In our […]