Custom Entry Points in WPF on .NET Core
Posted: January 31, 2020 Filed under: .NET, .NET Core, WPF | Tags: .NET, .NET Core, WPF 2 CommentsTo create a custom entry point for a WPF application that is created using the default template in Visual Studio and targets the .NET Framework, you can change the Build Action
property of the App.xaml
file from ApplicationDefinition
to Page
and create a class with a static Main
method. That’s what I did in a previous post about handling protocol activation and redirection in packaged apps.
Read »
Handle Protocol Activation and Redirection in Packaged Apps
Posted: May 10, 2019 Filed under: .NET, MSIX, WPF | Tags: .NET, C#, Desktop Bridge, MSIX, UWP, WPF 3 CommentsAn example of how to handle Uniform Resource Identifier (URI) protocol and file extension activation in a packaged WPF application.
Read »
WPF on .NET Core
Posted: December 15, 2018 Filed under: .NET, .NET Core, Windows Forms, WPF | Tags: .NET, .NET Core, Windows Forms, WPF 1 CommentMicrosoft announced at Build 2018 back in May that they are bringing .NET Core to the Windows desktop applications frameworks, including both WPF and Windows Forms. This means that your client applications will be able to take advantage of the various performance improvements that have been introduced in .NET Core and that you will be able to deploy them as self-contained executables (.exes) that have no dependency upon any pre-installed version of .NET. Read »
Implementing global hot keys in WPF
Posted: March 31, 2015 Filed under: .NET, C#, WPF | Tags: .NET, C#, WPF 7 CommentsIf you want your WPF application to be able to detect and handle key presses even when it is not currently activated or focused on the screen you could implement what is known as global hot keys in Windows.
A global, or system-wide, hot key is a key or a combination of keys that is associated with a particular window, which will receive messages whenever the user presses this key or key combination from anywhere in the system.
Read »
Enumerating collections that change in C#
Posted: February 28, 2015 Filed under: .NET, C# | Tags: .NET, C# 3 CommentsIf you try you remove an item from an IEnumerable while enumerating it using a foreach loop in C# you will get an InvalidOperationException saying that “Collection was modified; enumeration operation may not execute”.
Read »
Generic type parameters and dynamic types in C#
Posted: October 31, 2014 Filed under: .NET, C# | Tags: .NET, C# Leave a commentThere may be times when you need to use some type in your application that is not known until runtime. This post will explain what you need to do in order to be able to use such a dynamically loaded type from a dynamically loaded assembly as a generic type parameter when you create an instance of some generic class in your application.
Read »
Custom authorization in WPF
Posted: March 24, 2013 Filed under: .NET, C#, Security, WPF | Tags: .NET, C#, IIdentity, IPrincipal, MVVM, WPF, XAML 51 CommentsThis post provides a code sample on how to implement your own custom authentication and authorization in a WPF application by implementing classes that derive from the IIdentity and IPrincipal interfaces and overriding the application thread’s default identity.
Read »