I have exhausted my internet searches and cannot seem to find the best practice on styling my Windows Store App XAML elements based on data binding conditions?
<Style.Triggers><DataTrigger>...</DataTrigger></Style.Triggers>
doesn't appear to be available on Windows 8 Store Apps like it was in WPF, and the Visual State Manager is just for pre-set interaction states such as MouseOver
is it not? How can I dramatically change my UI depending on my underlying View Model?
To create a scenario for a clear answer to this question, what is the best practice / most widely accepted way to change a <TextBlock />
for example from one style to another depending on a data binding condition? I say style, because I know you could use a Converter for something like a colour, but what if my changes become quite complex? For instance adding a border, font size and background colour too?
My second scenario is I want to replace the Data
of a <Path />
tag depending on a view model condition, is this also possible? Basically, I have a 'cross' and 'tick' XAML path and would like to swap them out depending on view model property.
I am trying to adhere to MVVM where possible as well, so would also prefer not to be hard-coding style references in my code behind.
Thanks all.