File Window Layout: question on XAML markup

Started by Ger, Today at 09:47:01 AM

Previous topic - Next topic

Ger

I have a Category structure looking like this:
Collection
   |#Who
   |John
   |Mary
   |#n/a

In the file window layout, I want to show whether the file exists in a category under #Who or not. If the image is in #Who|#n/a, I want to flag that as well.

This works:
{File.Categories.Direct|contains:Collection|#Who|#n/a,isna, {File.Categories.Direct|contains:Collection|#Who,yes,no;
     pereplace:yes==WHO;
     pereplace:no==NoWho;
  };
     pereplace:isna==WHO=n/a;
}


However, if I want to add XAML, this only works for isna:

{File.Categories.Direct|contains:Collection|#Who|#n/a,isna, {File.Categories.Direct|contains:Collection|#Who,yes,no;
     pereplace:yes==<Run FontFamily="Consolas" Background="#008000" Foreground="#ffffff">&#160~;WHO&#160~;</Run>;
     pereplace:no==<Run FontFamily="Consolas" Background="#008000" Foreground="#ffffff">&#160~;NoWHO&#160~;</Run>;
  };
     pereplace:isna==<Run FontFamily="Consolas" Background="#ff0000" Foreground="#ffffff">&#160~;Who=n/a&#160~;</Run>;
}

For the yes and no values, the XAML text is displayed verbatim.

What am I doing wrong? And maybe I'm choosing the wrong solution here - happy to learn another way to solve this.


Mario

Use VarToy to see what your variable produces.
Use the Edit > Preferences > File Window Tip to try your variable (select a file which fails in the File Window before opening this dialog) to see if your XMAL produces an error message.

Ger

I used Vartoy to get the function working (without the XAML). It shows nicely WHO, NoWho and Who=n/a for the corresponding images.

In both FileWindow Tip and FileWindow Layout I tried the XAML markup. Only the prereplace:isna is displaying correctly; the other show the XAML statement verbatim.

Mario


Ger

That's what i figured. The XAML for isna 
pereplace:isna==<Run FontFamily="Consolas"
Background="#ff0000"
Foreground="#ffffff">&#160~;Who=n/a&#160~;</Run>;

is showing fine; the other two are just displaying literal text (<Run FontFam....)


Mario

When the markup code is displayed as text, the code is not OK. Check for missing <, simplify the variable until you can see the issue.