Updating images in a wpf application

We experiment with three different approaches of achieving that and discuss on which one to use depending on the situation.

In all cases, the image files are embedded within the application as “Resource” files.

I recently switched from Forms to WPF to gain some new expertise.

Windows 8.1 gives developers new functionality to create desktop applications that are per-monitor DPI-aware.In this Data Template, the Source property is not directly Data Bound to any property.We use a Data Template trigger to test the value of the Picture ID property and based on the result decide which image to display.Now if your images are not resources in the Assembly and reside somewhere in the server where you deploy your application you need to change the paths for all approaches to: “pack://siteoforigin:,,,/Images/0.png” where the “pack://siteoforigin:,,,” says “the root of the application” and then you provide the path for the image.Finally in case you are wondering in the project the property Is Synchonized With Current Item=true maintains the same selection for all the three List Boxes in the project since they are bound to the same list of Item objects.

Leave a Reply