❔ WPF Converter Infinite call
Hi!
I am trying to make a converter that makes fontsize relative to the binding by ratio
the problem is that it is jumping around as seen in the picture
my xaml:
16 Replies
converter code:
so many value checks because ActualHeight can be NaN, 0, etc.
and other stuff, as such to not get errors i had to define custom values
Uhh... can't
ViewBox
stretch TextBox
?
Viewbox
rather, with StretchDirection="DownOnly"
First time do i hear about strechdirection im gonna look it up rn, thank you
the important for me thing is to preserve this behavior
(of course it would be for whole item scaling
sadly doesn't work
it scales the whole object disabling the wraping
I've tried to do such thing with stretch uniform but it didnt work
might have to play with it myself, but generally wrapping makes calculating desired font size a lot harder
this seems to be working
but only in preview window, and when scaled down and then up, the content disappears
seems to happen when the description hits 4 lines
ah I've had this actual specific issue before with stuff disappearing when resizing
as far as I can remember from the day I spent on it, I didn't find a solution and straight up re-designed my UI
so binding to the size of stuff is generally a bad idea, causes more problems than it solves
Stack Overflow
How do I get a textblock with textwrapping to fill a viewbox
The XAML is a page with a list of items on it inside a Viewbox. The goal is to have a department name and them a paragraph of notes underneath that. I set the background of my itemscontrol to be Re...
there's a partial solution here, but that's about as good as you can do
dynamic stuff is often a pain, generally involves rolling a custom control from the ground up if you need it to behave a very specific way
I often just redesign my UX when I run into limitations rather than spend another day trying to wrestle the framework into submission
Thank you very much for all of your help. I too am close to redesigning it as whole, although i did have some plans like adding swipe controls that i'll have to rethink due to that
as a last ditch effort i'll see into overriding viewbox's measure method to scale stuff purely based on the height of the viewbox rather than also it's width
I have found this great thread and I am with my whole might trying to decode it
https://stackoverflow.com/questions/4542835/making-a-viewbox-scale-vertically-but-stretch-horizontally
Stack Overflow
Making a Viewbox scale vertically but stretch horizontally
I want to make a Viewbox (or something similar) that scales only its height, and then stretches its content horizontally.
If I do this:
<Viewbox>
<StackPanel>
<Button>Foo</
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.