Skip to main content

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 […]

WPF – Change color of a row in a DataGrid depending on the value with DataTrigger

Hi folks, Today we will see how to change the color or a row depending on the value of the content. To do that, create a simple View: <Window x:Class=”DataTrigger_Test.MainWindow” xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” xmlns:d=”http://schemas.microsoft.com/expression/blend/2008″ xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″ mc:Ignorable=”d” Title=”MainWindow” Height=”350″ Width=”525″> <Grid> <DataGrid Margin=”10″ ItemsSource=”{Binding Users}” AutoGenerateColumns=”False” ColumnWidth=”*” HorizontalAlignment=”Stretch” VerticalAlignment=”Stretch” HorizontalContentAlignment=”Stretch” EnableRowVirtualization=”false” EnableColumnVirtualization=”false” CanUserAddRows=”False” CanUserReorderColumns=”False” CanUserResizeColumns=”True”> <DataGrid.CellStyle> <Style […]

Xamarin.Forms – Use built-in Dependency Injection (IoC)

Hello Devz, Xamarin.Forms have its own Dependency Injection implementation. Of course you can still use other ones like MvvmCross, Ninject and so on, but they will ask you a bit more configuration and changes in your code. The one from Xamarin.Forms works pretty well and is really simple to use. Here is a simple example. […]