Tabular Layout (File Name)

Started by Darius1968, February 27, 2019, 06:51:40 AM

Previous topic - Next topic

Darius1968

I'm trying to get my tabular layout to display the file name, which I can achieve.  But, I haven't yet figured out how to let the text wrap into two or more lines, if the column width is shortened.  So far, this is all the better I can come up, without success.  So, can someone give me the proper XAML syntax. 
<TextBlock TextWrapping="Wrap"> {File.Name|pereplace:{cr}{lf}==</Run><LineBreak/><Run>;prefix:<Run>;postfix:</Run>} </TextBlock>

sinus

Darius
I do not really know.
But in my case, depending of the filename, I could use to replace a unique letter (or more) to break the line.

Means, with my filename:
19690721-1735-359634-s-pri-hist-mondlandung_a

If I replace your
...pereplace:{cr}{lf}==...

with
...pereplace:_==...

19690721-1735-359634-s-pri-hist-mondlandung
a

or if I replace it with
...pereplace:pri==...

it breaks:
19690721-1735-359634-s-
-hist-mondlandung_a

If I want have also the replaced characters, I use
...pereplace:pri==</Run><LineBreak/>pri<Run>;prefix:...

It depends, if you have a unique character, where to break.
Simply work with the TextWrapping="Wrap" works here also not, at least I do not know how (in Design & Print it works, here not)
Best wishes from Switzerland! :-)
Markus

Mario

Line wrapping is only performed on spaces and tabs and .

If your file names contain none of these, wrapping cannot happen.
Have you tried with just the normal file name attribute (no markup)?

This uses the default Windows text wrapping, which wraps the next nicely if there is one of the wrapping characters listed above. it cannot wrap if there is no wrapping character.
For example, if the file name segments are separated by - no wrapping is performed. In that case you can use markup and do a

replace:-==-<space>

where <space> is a space (blankThis then allows the wrapping to work, because it replaces reach - in your file name with -<space>.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

monochrome

I haven't tried this in IMatch, but I use it in HTML: Another thing you can try is replace a "suitable break" character with it plus a zero-width space. Most HTML layout engines know to break at the zero-width space, and if they don't break, you don't see it.

So: replace:-==-​ to wrap on hyphens.