Skip to main content

WPF – Animated Image

It is sometimes interesting to have an animated icon to tell to our user that their command is actually processing. Typically for a refresh icon. So, two solution: you could use an animated GIF and use an external library like WpfAnimatedGif (or the XAML MediaElement), or use an rounded icon (like this one) and create […]

WPF – Animated text

Sometimes it can be useful to have an animated text even in WPF. Typically a “Loading…”, where the 3 dots are moving one by one. Here is a simple way to do an animation with text:

With a ViewModel looking like (using PRISM 6.3):

Here is another post talking about animated images. Happy […]

WPF – Nullable binding

Hello Devz, Imagine you have a TextBox binded to a nullable integer and you put a value in it. Now let’s say you delete this value. You expect to have your value to be null. To be able to do that, you need to update the properties of you binding like this:

Please notice […]

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:

The Application.Current.MainWindow is the solution… But please pay attention that this parameter can be different! Indeed it’s an implementation of IWin32Window that will own the modal dialog […]

WPF – Change color of a row in a DataGrid

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:

The important thing here  are the DataTriggers. If a condition is met, it will apply a value to a property. For example, the first trigger is: […]

WPF – DataGrid with single click checkbox

The problem with the checkbox in a WPF DataGrid By default, if you place a checkbox in a WPF DataGrid, you will have to click twice to check or uncheck the checkbox. And there is a logical explanation. The first click will select the row in the DataGrid, and the second one, the checkbox in […]