user228137
user228137

Reputation: 762

Scale text in a grid/viewbox upon pinching

For a day now I'm struggling to solving this issue, regarding scaling a textblock and a textbox upon pinching the scatterViewItem for resizing it. I've tried putting each of the elements in their viewbox, but also having the whole grid in a viewbox. The issue is that it(the textbloxk, that is) doesn't scale upon pinching or stretching rather, (dynamically so to speak) - at runtime, or not even upon contact_up.

Upvotes: 0

Views: 441

Answers (2)

user228137
user228137

Reputation: 762

What actually solves it is simply setting an event handler that fires upon size_changed of the SVI, inside simply paste the code:

{label name}.FontSize *= (double)e.NewSize.Height / (double)e.PreviousSize.Height;

Thanks!

Upvotes: 2

CaffeineZombie
CaffeineZombie

Reputation: 184

I am assuming you mean that the TextBlock in the window does not scale when resizing the window...? Have you tried putting a ViewBox in a Grid that contains the item you want to resize? If you have the item in a ViewBox, and set the Height and Width of the ViewBox to Auto, is should resize with the window...I hope this helps a little.

Upvotes: 1

Related Questions