How to make slight modifications to a WPF View based on some configuration
we have a MVVM application and a requirement saying (simplified for the
example) that based on the value of one int property we should make slight
modifications to a View.
For example, if the property has a value of 1 we should change the
background color of one View's button, if the value is 2 we should hide
one Label and put in bold the text of a TextBox, if the value is 14 we
should hide 2 Labels.
As the values could be decided after building the application we would
like something like a file, an assembly loaded at runtime with reflection
or whatever specifying what has to be done on the view.
The main idea is to create the View, put a name on all the available items
and pass it to a class defined in an assembly loaded at runtime that will
know what to do with the View. The problem we see with this approach is
that you need to define names for everything on the View.
Do you think is there a better approach to fulfill the requirement? The
changes to do on the View will be always just a few properties.
Thanks in advance.
No comments:
Post a Comment