By utilizing the implicit styling approach you have the ability to switch the theme of Telerik WPF controls at run-time. With the large set of themes available in the suite this can drastically change the look and feel of your application.

To help you achieve a consistent look we also provide a way for you to dynamically change the images in your application through the IconResourcemarkup extension. The extension allows you to define three different URI-based paths which point to set of icons and then easily swap one set with another.

Example 2: Setting Paths to IconSources

Once the paths are set, the IconResource extension can be used to set the source of objects of type ImageSource. Example 3 shows how to define an Image object in XAML pointing to the background.png image in the folder paths from Example 2.

Figure 2: Image After Changing the IconSet

Several of the controls in the Telerik UI for WPF suite come with sets of icons that can be used with them. The paths to all such images are consistent with the requirements imposed by the IconResource extension, so you can use it to switch those icons run-time.

RadPdfViewer, for example, comes with two distinct sets of icons located in the Telerik.Windows.Controls.FixedDocumentViewers assembly. Defining an IconSources resource for the viewer is shown on Example 5.

Example 6: ImageSource Set to RadPdfViewer Icon

Both IconSource resources defined in the article are in the same view pointing to different base paths for images. The result of Example 6 is shown on Figure 3.

Figure 3: ImageSource Set to RadPdfViewer Icon

Changing the icon set used in the application with the code from Example 4 will change it for both images, regardless of the fact that they use separate base paths. The result is demonstrated on Figure 4.

Figure 4: Images After Changing the IconSet

You can find the complete code of the previous example in our online SDK repository here.