I would like to change the style of some DataGrid columns / cells (background, font weight, etc.) based on regular expressions. I have more than a few thousand rows and about 20 regular expressions to evaluate.
For the time being, I extended my model via an Enum which I evaluate in the view model via an extension method. Everything works fine but it is not efficient.
I don't really want to :
- store the
Enumin the database. - to evaluate the regular expressions inside the value converters because I would like to share the logic among different project (ASP.Net, etc.) Moreover, this would require to duplicate the logic for each value converter.
Is it possible to know the rows which are displayed in the view model in order to update them only (taking into account the scroll, window size, etc.)?
Otherwise, what would be a more efficient strategy?