xaml: VerticalAlignment Center and Bottom works not

Started by sinus, February 06, 2023, 03:43:21 PM

Previous topic - Next topic

sinus

Hi Mario
I do not know, is this a glitch in Design&Print or is it written wrong in the help-file.
Some month ago, I struggled over this, now again.

In Design&Print, if I use XAML and the commands, what are very good described in the help-file, they simply do not work.
This is of course a low prio, but since you hates errors  ;D - I think, you could look into this somtime.

The commands, what not works is:
VerticalAlignment="Center"
VerticalAlignment="Bottom"

The text does not move in the center or to bottom, it stays on top.

You have even an example in the help-file with a example (I love your examples, really), what simply also not works.
The example is here https://www.photools.com/help/imatch/xaml_basics.htm
and I have also attached an image.

You have also another example here:
https://www.photools.com/help/imatch/impexp_print.htm
I have also attched it.

I know, that XAML is different and not all things works everywhere, but here I think, is something wrong, specially if you describes this in the help so good. 

I have also attached a small template with D&P (I have added .txt at the end, but it is a imptx, and a jpg from there. 
I know, you have just now a lot other things to do, therefore: low prio of course.

Best wishes from Switzerland! :-)
Markus

Mario

The text alignment in Design & Print is controlled via the text block alignment properties, not manually via XAML code.

Image7.jpg

Text block alignment in XAML is ignored.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Thanks a lot, Mario.
At the moment I running a longer IMatch-task, what I want not break for testing this.

But I see from your attachment, that it seems to work.
I have tried this also, but I guess, I have not tried it together with "Interpret as XAML" on. 

I am very glad, that it seems to work! Thanks again.  :)
Best wishes from Switzerland! :-)
Markus

sinus

Hi Mario
Problem solved!  :)

Only for your info, no more work for you:

Most of my text-fields does work with the "diu-stuff".
Because my computer at home has some other resolution, with diu it works perfect.
I must only be sure, that e.g. the height in the "XAML-line" is the same as in the text-box. If they do not match, some text is maybe cutted.

Hence I have e.g. a text-field with this command/variable:

<TextBlock Foreground='#000000' FontFamily='Tahoma' FontSize='8.0pt|diu' Width='9.0cm|diu' Height='4.5cm|diu' TextWrapping='Wrap' VerticalAlignment='Bottom' HorizontalAlignment='Left' TextAlignment='Right' FontWeight='Normal'>{File.MD.XMP::dc\description\Description\0|numcomp:gt,506,{File.MD.XMP::dc\description\Description\0|substr:0,506}...,{File.MD.XMP::dc\description\Description\0},length}</TextBlock>{File.Annotations}

And with something like this the "center and bottom-alignments" works not. Wherever I change the alignment, in this command or in the text-block, with or without XAML enabled, it works simply not. At least not here on my main computer.
That is why I struggled.

BUT: I thought, if it works for you, it must also work here. Hence I tried again and again, and then: success.  :)
If I delete the Height='4.5cm|diu' from the lines above, all works perfect.
Somehow this irritates the center-bottom-alignement.

Hence I think, what you did yesterday, to check this, you did this without the height in you lines. And then it works.
If you would have entered the Height, I guess, it would have not worked.

Finally I have deleted the height from the XAML-lines, and now all is perfect! :) Thanks!

Best wishes from Switzerland! :-)
Markus

Mario

Forcing a specific height to the container while at the same time trying to align it will most likely not work.
The implicit height overrides the alignment. And when you make the container higher that the available page space, it will vanish entirely. XAML can do a lot nut not everything. Keep in mind that the XAML you produce is wrapped in another XAML container that does the overall alignment of the text block inside the text container. You can break that by going to wild with XAML. Using XAML should be the exception, not the rule.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Jingo