Question

WPF makes it very easy to create conditional formatting rules at design time based the underlying bound data values.

Are there any existing solutions that allow end users to create conditional formatting rules at run time?

Edit: I understand how to apply conditional formatting. I am curious if there are existing solutions that provide mechanisms for end users to create custom styles at run time

Edit: Excel's Conditional Formatting capability could be viewed as an example of the type of capability I am looking for

Was it helpful?

Solution

Karl Shifflett did a demo LOB application in WPF a few years ago. He demonstrated a way to dynamically load XAML "skins" in your application. Using this type of logic, a customer could create XAML and load it dynamically to skin the application, or you could provide an interface for a customer to dynamically change style properties and have the application appearance change based on those property settings.

His example is on his blog as well as on the Code Project.

OTHER TIPS

Everything done in WPF via XAML can be done in C#, so you can create styles and triggers with C# only.

Here's an example.

For runtime formatting solutions, I would suggest using value converters.

You can get inputs from end users on what kind of formatting they need. And apply them in converters.

The following link How to customize tool item and tool container may help you. The LinsUIWPF suite is a free software. It allows end client to customize all tool items and tool container style.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top