Skip to main content

WPF – MessageBox on top of the other Views

Hello devz, It happens sometimes with WPF that a popup or a MessageBox is hidden and can block the whole application. To avoid this, just do the following: var msgBoxResult = MessageBox.Show(Application.Current.MainWindow, “Are you sure?”, “Delete item”, MessageBoxButton.YesNo, MessageBoxImage.Question); The Application.Current.MainWindow is the solution… But please pay attention that this parameter can be different! Indeed it’s […]

C# – Simple email validation regex

Hello Devz, Do you have a web or WPF application that needs email address validation? Regex (regular expression) can help you. This post outlines a simple email validation regex that you can use straight away. What is a regex? A regular expression (regex for short) describes a search pattern using a particular text string. It’s […]

C# – DistinctBy extension

Hello devz, The Distinct extension from System.Linq is really useful but the DistinctBy a property is missing. So we will create our own DistinctBy extension. No worries, it’s really easy. What is DistinctBy? DistinctBy is a very simple extension snippet for C# which allows the developer to remove duplicated objects in a collection based on […]

C# – Coma and Dot decimal separator

Hi peeps, You probably know the common issue with the decimal seprator. Depending on the country, the keyboard or what your client wants (which can be variable…), the separator will be a coma or a dot (or even something else…). In my case, the Culture is “en-US“, on a Belgian keyboard where the decimal separator […]