I'm not sure if there are any problems in your code, but I made a simple code example. He can achieve your goal.
Please check the following code:
<Grid Background="Red" Height="200" ManipulationDelta="StackPanel_ManipulationDelta" ManipulationMode="Scale">
<TextBlock FontFamily="Verdana"
FontSize="32"
FontWeight="Bold"
Foreground="SteelBlue"
Text="Scaled Text" IsTextScaleFactorEnabled="True">
<TextBlock.RenderTransform>
<ScaleTransform x:Name="ScaleTransform" ScaleX="1.0" ScaleY="1.0" />
</TextBlock.RenderTransform>
</TextBlock>
</Grid>
private void Grid_ManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
{
ScaleTransform.ScaleX *= e.Delta.Scale;
ScaleTransform.ScaleY *= e.Delta.Scale;
}
source
share