hasvalue no XAML interpretation

Started by Arthur, December 17, 2017, 08:48:04 PM

Previous topic - Next topic

Arthur

After reading through the IMatch help, I wanted to pimp my file window, to show:

K green/red = Keyword assigned/not assigned
C green/red = Category assigned/not assigned
M green/red = Metadata written/write pending

This would mimic the badges in Lightroom a bit.
For the first part I created a custom template for my layout as following:

{File.MD.hierarchicalkeywords|default:<TextBlock Foreground='#FF0000'>K</TextBlock>;hasvalue:<TextBlock Foreground='#00FF00'>K</TextBlock>}

The problem is that while for the default case I get a red K as expected, in the hasvalue case I get the text as written. No XAML interpretation takes place.

Bug or feature?

Mario

#1
IMatch escapes unsafe characters for features producing XAML. So the default is wrong(ish) and the hasvalue is right because it shows the markup as text.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Arthur

The default case works, the hasvalue case not. I even copied the same value to both if .. else branches to ensure that there is no typo. Same result, only one branch seems to go through the XAML parser.

Just wanted to try out, what is written here: https://www.photools.com/3906/custom-icons-file-window/

Mario

If you consider this behavior to be bug, please file a bug report. I will then look into this for one of the next versions.
Note that not escaping variable data is wrong, because this may lead to broken XAML in the file window. Variables must replace/escape special characters like < and > for safety reasons.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo

Check the other thread you created for the solution... enjoy!